Mercurial > vim
annotate src/testdir/test_vim9_cmd.vim @ 29599:691c8adef6f3 v9.0.0140
patch 9.0.0140: execute() does not use the "legacy" command modifier
Commit: https://github.com/vim/vim/commit/3d3f6ac09859905405f35f50b2b7c57ccf40fb47
Author: Kota Kato <peony.btn@gmail.com>
Date: Thu Aug 4 18:50:14 2022 +0100
patch 9.0.0140: execute() does not use the "legacy" command modifier
Problem: execute() does not use the "legacy" command modifier.
Solution: pass the command modifier in sticky_cmdmod_flags. (Kota Kato,
closes #10845)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 04 Aug 2022 20:00:08 +0200 |
parents | a712ea475390 |
children | 2da1753e6a4a |
rev | line source |
---|---|
20170
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 " Test commands that are not compiled in a :def function |
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 |
20172
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
3 source check.vim |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
4 import './vim9.vim' as v9 |
22772
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
5 source term_util.vim |
21156
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
6 source view_util.vim |
20170
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
7 |
23938
2a885d095bff
patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places
Bram Moolenaar <Bram@vim.org>
parents:
23823
diff
changeset
|
8 def Test_vim9cmd() |
2a885d095bff
patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places
Bram Moolenaar <Bram@vim.org>
parents:
23823
diff
changeset
|
9 var lines =<< trim END |
2a885d095bff
patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places
Bram Moolenaar <Bram@vim.org>
parents:
23823
diff
changeset
|
10 vim9cmd var x = 123 |
2a885d095bff
patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places
Bram Moolenaar <Bram@vim.org>
parents:
23823
diff
changeset
|
11 let s:y = 'yes' |
2a885d095bff
patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places
Bram Moolenaar <Bram@vim.org>
parents:
23823
diff
changeset
|
12 vim9c assert_equal(123, x) |
2a885d095bff
patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places
Bram Moolenaar <Bram@vim.org>
parents:
23823
diff
changeset
|
13 vim9cm assert_equal('yes', y) |
2a885d095bff
patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places
Bram Moolenaar <Bram@vim.org>
parents:
23823
diff
changeset
|
14 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
15 v9.CheckScriptSuccess(lines) |
25622
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
16 |
24596
acd9220bdd0b
patch 8.2.2837: various code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
24545
diff
changeset
|
17 assert_fails('vim9cmd', 'E1164:') |
25622
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
18 assert_fails('legacy', 'E1234:') |
25620
49a798fa0e73
patch 8.2.3346: Vim9: no error for using "." for concatenation after ":vim9cmd"
Bram Moolenaar <Bram@vim.org>
parents:
25605
diff
changeset
|
19 assert_fails('vim9cmd echo "con" . "cat"', 'E15:') |
25374
7124992f26ef
patch 8.2.3224: cannot call script-local function after :vim9cmd
Bram Moolenaar <Bram@vim.org>
parents:
24834
diff
changeset
|
20 |
7124992f26ef
patch 8.2.3224: cannot call script-local function after :vim9cmd
Bram Moolenaar <Bram@vim.org>
parents:
24834
diff
changeset
|
21 lines =<< trim END |
25622
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
22 let str = 'con' |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
23 vim9cmd str .= 'cat' |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
24 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
25 v9.CheckScriptFailure(lines, 'E492:') |
25622
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
26 |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
27 lines =<< trim END |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
28 vim9script |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
29 legacy echo "con" . "cat" |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
30 legacy let str = 'con' |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
31 legacy let str .= 'cat' |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
32 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
33 v9.CheckScriptSuccess(lines) |
25622
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
34 |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
35 lines =<< trim END |
25374
7124992f26ef
patch 8.2.3224: cannot call script-local function after :vim9cmd
Bram Moolenaar <Bram@vim.org>
parents:
24834
diff
changeset
|
36 vim9script |
7124992f26ef
patch 8.2.3224: cannot call script-local function after :vim9cmd
Bram Moolenaar <Bram@vim.org>
parents:
24834
diff
changeset
|
37 def Foo() |
7124992f26ef
patch 8.2.3224: cannot call script-local function after :vim9cmd
Bram Moolenaar <Bram@vim.org>
parents:
24834
diff
changeset
|
38 g:found_bar = "bar" |
7124992f26ef
patch 8.2.3224: cannot call script-local function after :vim9cmd
Bram Moolenaar <Bram@vim.org>
parents:
24834
diff
changeset
|
39 enddef |
7124992f26ef
patch 8.2.3224: cannot call script-local function after :vim9cmd
Bram Moolenaar <Bram@vim.org>
parents:
24834
diff
changeset
|
40 nmap ,; :vim9cmd <SID>Foo()<CR> |
7124992f26ef
patch 8.2.3224: cannot call script-local function after :vim9cmd
Bram Moolenaar <Bram@vim.org>
parents:
24834
diff
changeset
|
41 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
42 v9.CheckScriptSuccess(lines) |
25622
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
43 |
25374
7124992f26ef
patch 8.2.3224: cannot call script-local function after :vim9cmd
Bram Moolenaar <Bram@vim.org>
parents:
24834
diff
changeset
|
44 feedkeys(',;', 'xt') |
7124992f26ef
patch 8.2.3224: cannot call script-local function after :vim9cmd
Bram Moolenaar <Bram@vim.org>
parents:
24834
diff
changeset
|
45 assert_equal("bar", g:found_bar) |
7124992f26ef
patch 8.2.3224: cannot call script-local function after :vim9cmd
Bram Moolenaar <Bram@vim.org>
parents:
24834
diff
changeset
|
46 nunmap ,; |
7124992f26ef
patch 8.2.3224: cannot call script-local function after :vim9cmd
Bram Moolenaar <Bram@vim.org>
parents:
24834
diff
changeset
|
47 unlet g:found_bar |
25622
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
48 |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
49 lines =<< trim END |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
50 vim9script |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
51 legacy echo 1'000 |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
52 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
53 v9.CheckScriptFailure(lines, 'E115:') |
25622
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
54 |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
55 if has('float') |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
56 lines =<< trim END |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
57 vim9script |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
58 echo .10 |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
59 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
60 v9.CheckScriptSuccess(lines) |
25622
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
61 lines =<< trim END |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
62 vim9cmd echo .10 |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
63 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
64 v9.CheckScriptSuccess(lines) |
25622
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
65 lines =<< trim END |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
66 vim9script |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
67 legacy echo .10 |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
68 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
69 v9.CheckScriptFailure(lines, 'E15:') |
25622
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
70 endif |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
71 |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
72 echo v:version |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
73 assert_fails('vim9cmd echo version', 'E121:') |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
74 lines =<< trim END |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
75 vim9script |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
76 echo version |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
77 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
78 v9.CheckScriptFailure(lines, 'E121:') |
25622
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
79 lines =<< trim END |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
80 vim9script |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
81 legacy echo version |
15b54e0a576b
patch 8.2.3347: check for legacy script is incomplete
Bram Moolenaar <Bram@vim.org>
parents:
25620
diff
changeset
|
82 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
83 v9.CheckScriptSuccess(lines) |
23938
2a885d095bff
patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places
Bram Moolenaar <Bram@vim.org>
parents:
23823
diff
changeset
|
84 enddef |
2a885d095bff
patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places
Bram Moolenaar <Bram@vim.org>
parents:
23823
diff
changeset
|
85 |
28934
a712ea475390
patch 8.2.4989: cannot specify a function name for :defcompile
Bram Moolenaar <Bram@vim.org>
parents:
28895
diff
changeset
|
86 def Test_defcompile_fails() |
a712ea475390
patch 8.2.4989: cannot specify a function name for :defcompile
Bram Moolenaar <Bram@vim.org>
parents:
28895
diff
changeset
|
87 assert_fails('defcompile NotExists', 'E1061:') |
a712ea475390
patch 8.2.4989: cannot specify a function name for :defcompile
Bram Moolenaar <Bram@vim.org>
parents:
28895
diff
changeset
|
88 assert_fails('defcompile debug debug Test_defcompile_fails', 'E488:') |
a712ea475390
patch 8.2.4989: cannot specify a function name for :defcompile
Bram Moolenaar <Bram@vim.org>
parents:
28895
diff
changeset
|
89 assert_fails('defcompile profile profile Test_defcompile_fails', 'E488:') |
a712ea475390
patch 8.2.4989: cannot specify a function name for :defcompile
Bram Moolenaar <Bram@vim.org>
parents:
28895
diff
changeset
|
90 enddef |
a712ea475390
patch 8.2.4989: cannot specify a function name for :defcompile
Bram Moolenaar <Bram@vim.org>
parents:
28895
diff
changeset
|
91 |
a712ea475390
patch 8.2.4989: cannot specify a function name for :defcompile
Bram Moolenaar <Bram@vim.org>
parents:
28895
diff
changeset
|
92 defcompile Test_defcompile_fails |
a712ea475390
patch 8.2.4989: cannot specify a function name for :defcompile
Bram Moolenaar <Bram@vim.org>
parents:
28895
diff
changeset
|
93 defcompile debug Test_defcompile_fails |
a712ea475390
patch 8.2.4989: cannot specify a function name for :defcompile
Bram Moolenaar <Bram@vim.org>
parents:
28895
diff
changeset
|
94 defcompile profile Test_defcompile_fails |
a712ea475390
patch 8.2.4989: cannot specify a function name for :defcompile
Bram Moolenaar <Bram@vim.org>
parents:
28895
diff
changeset
|
95 |
27645
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
96 def Test_cmdmod_execute() |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
97 # "legacy" applies not only to the "exe" argument but also to the commands |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
98 var lines =<< trim END |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
99 vim9script |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
100 |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
101 b:undo = 'let g:undone = 1 | let g:undtwo = 2' |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
102 legacy exe b:undo |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
103 assert_equal(1, g:undone) |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
104 assert_equal(2, g:undtwo) |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
105 END |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
106 v9.CheckScriptSuccess(lines) |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
107 |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
108 # same for "vim9cmd" modifier |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
109 lines =<< trim END |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
110 let b:undo = 'g:undone = 11 | g:undtwo = 22' |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
111 vim9cmd exe b:undo |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
112 call assert_equal(11, g:undone) |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
113 call assert_equal(22, g:undtwo) |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
114 END |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
115 v9.CheckScriptSuccess(lines) |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
116 unlet b:undo |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
117 unlet g:undone |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
118 unlet g:undtwo |
27663
df84fac1e9a4
patch 8.2.4357: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27645
diff
changeset
|
119 |
df84fac1e9a4
patch 8.2.4357: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27645
diff
changeset
|
120 # "legacy" does not apply to a loaded script |
df84fac1e9a4
patch 8.2.4357: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27645
diff
changeset
|
121 lines =<< trim END |
df84fac1e9a4
patch 8.2.4357: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27645
diff
changeset
|
122 vim9script |
df84fac1e9a4
patch 8.2.4357: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27645
diff
changeset
|
123 export var exported = 'x' |
df84fac1e9a4
patch 8.2.4357: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27645
diff
changeset
|
124 END |
df84fac1e9a4
patch 8.2.4357: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27645
diff
changeset
|
125 writefile(lines, 'Xvim9import.vim') |
df84fac1e9a4
patch 8.2.4357: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27645
diff
changeset
|
126 lines =<< trim END |
df84fac1e9a4
patch 8.2.4357: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27645
diff
changeset
|
127 legacy exe "import './Xvim9import.vim'" |
df84fac1e9a4
patch 8.2.4357: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27645
diff
changeset
|
128 END |
df84fac1e9a4
patch 8.2.4357: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27645
diff
changeset
|
129 v9.CheckScriptSuccess(lines) |
df84fac1e9a4
patch 8.2.4357: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27645
diff
changeset
|
130 delete('Xvim9import.vim') |
27678
1646525507aa
patch 8.2.4365: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27669
diff
changeset
|
131 |
1646525507aa
patch 8.2.4365: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27669
diff
changeset
|
132 # "legacy" does not aply to a called function |
1646525507aa
patch 8.2.4365: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27669
diff
changeset
|
133 lines =<< trim END |
1646525507aa
patch 8.2.4365: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27669
diff
changeset
|
134 vim9script |
1646525507aa
patch 8.2.4365: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27669
diff
changeset
|
135 |
1646525507aa
patch 8.2.4365: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27669
diff
changeset
|
136 def g:TheFunc() |
1646525507aa
patch 8.2.4365: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27669
diff
changeset
|
137 if exists('something') |
1646525507aa
patch 8.2.4365: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27669
diff
changeset
|
138 echo 'yes' |
1646525507aa
patch 8.2.4365: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27669
diff
changeset
|
139 endif |
1646525507aa
patch 8.2.4365: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27669
diff
changeset
|
140 enddef |
1646525507aa
patch 8.2.4365: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27669
diff
changeset
|
141 legacy exe 'call g:TheFunc()' |
1646525507aa
patch 8.2.4365: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27669
diff
changeset
|
142 END |
1646525507aa
patch 8.2.4365: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27669
diff
changeset
|
143 v9.CheckScriptSuccess(lines) |
1646525507aa
patch 8.2.4365: sticky command modifiers are too sticky
Bram Moolenaar <Bram@vim.org>
parents:
27669
diff
changeset
|
144 delfunc g:TheFunc |
29599
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
145 |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
146 # vim9cmd execute(cmd) executes code in vim9 script context |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
147 lines =<< trim END |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
148 vim9cmd execute("g:vim9executetest = 'bar'") |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
149 call assert_equal('bar', g:vim9executetest) |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
150 END |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
151 v9.CheckScriptSuccess(lines) |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
152 unlet g:vim9executetest |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
153 |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
154 lines =<< trim END |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
155 vim9cmd execute(["g:vim9executetest1 = 'baz'", "g:vim9executetest2 = 'foo'"]) |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
156 call assert_equal('baz', g:vim9executetest1) |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
157 call assert_equal('foo', g:vim9executetest2) |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
158 END |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
159 v9.CheckScriptSuccess(lines) |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
160 unlet g:vim9executetest1 |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
161 unlet g:vim9executetest2 |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
162 |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
163 # legacy call execute(cmd) executes code in vim script context |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
164 lines =<< trim END |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
165 vim9script |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
166 legacy call execute("let g:vim9executetest = 'bar'") |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
167 assert_equal('bar', g:vim9executetest) |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
168 END |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
169 v9.CheckScriptSuccess(lines) |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
170 unlet g:vim9executetest |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
171 |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
172 lines =<< trim END |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
173 vim9script |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
174 legacy call execute(["let g:vim9executetest1 = 'baz'", "let g:vim9executetest2 = 'foo'"]) |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
175 assert_equal('baz', g:vim9executetest1) |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
176 assert_equal('foo', g:vim9executetest2) |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
177 END |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
178 v9.CheckScriptSuccess(lines) |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
179 unlet g:vim9executetest1 |
691c8adef6f3
patch 9.0.0140: execute() does not use the "legacy" command modifier
Bram Moolenaar <Bram@vim.org>
parents:
28934
diff
changeset
|
180 unlet g:vim9executetest2 |
27645
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
181 enddef |
1712b102d642
patch 8.2.4348: "legacy exe cmd" does not do what one would expect
Bram Moolenaar <Bram@vim.org>
parents:
27585
diff
changeset
|
182 |
20170
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
183 def Test_edit_wildcards() |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
184 var filename = 'Xtest' |
20170
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
185 edit `=filename` |
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
186 assert_equal('Xtest', bufname()) |
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
187 |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
188 var filenr = 123 |
20170
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
189 edit Xtest`=filenr` |
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
190 assert_equal('Xtest123', bufname()) |
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
191 |
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
192 filenr = 77 |
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
193 edit `=filename``=filenr` |
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
194 assert_equal('Xtest77', bufname()) |
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
195 |
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
196 edit X`=filename`xx`=filenr`yy |
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
197 assert_equal('XXtestxx77yy', bufname()) |
23197
4ba101403fa2
patch 8.2.2144: Vim9: some corner cases not tested
Bram Moolenaar <Bram@vim.org>
parents:
23156
diff
changeset
|
198 |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
199 v9.CheckDefFailure(['edit `=xxx`'], 'E1001:') |
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
200 v9.CheckDefFailure(['edit `="foo"'], 'E1083:') |
24806
28127371aa18
patch 8.2.2941: Vim9: using does not handle a list of strings
Bram Moolenaar <Bram@vim.org>
parents:
24614
diff
changeset
|
201 |
28127371aa18
patch 8.2.2941: Vim9: using does not handle a list of strings
Bram Moolenaar <Bram@vim.org>
parents:
24614
diff
changeset
|
202 var files = ['file 1', 'file%2', 'file# 3'] |
28127371aa18
patch 8.2.2941: Vim9: using does not handle a list of strings
Bram Moolenaar <Bram@vim.org>
parents:
24614
diff
changeset
|
203 args `=files` |
28127371aa18
patch 8.2.2941: Vim9: using does not handle a list of strings
Bram Moolenaar <Bram@vim.org>
parents:
24614
diff
changeset
|
204 assert_equal(files, argv()) |
26305
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
205 |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
206 filename = 'Xwindo' |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
207 windo edit `=filename` |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
208 assert_equal('Xwindo', bufname()) |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
209 |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
210 filename = 'Xtabdo' |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
211 tabdo edit `=filename` |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
212 assert_equal('Xtabdo', bufname()) |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
213 |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
214 filename = 'Xargdo' |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
215 argdo edit `=filename` |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
216 assert_equal('Xargdo', bufname()) |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
217 |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
218 :%bwipe! |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
219 filename = 'Xbufdo' |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
220 bufdo file `=filename` |
ce891b60bdcd
patch 8.2.3683: Vim9: cannot use in :...do commands
Bram Moolenaar <Bram@vim.org>
parents:
26250
diff
changeset
|
221 assert_equal('Xbufdo', bufname()) |
20170
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
222 enddef |
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
223 |
23370
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
224 def Test_expand_alternate_file() |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
225 var lines =<< trim END |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
226 edit Xfileone |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
227 var bone = bufnr() |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
228 edit Xfiletwo |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
229 var btwo = bufnr() |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
230 edit Xfilethree |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
231 var bthree = bufnr() |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
232 |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
233 edit # |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
234 assert_equal(bthree, bufnr()) |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
235 edit %% |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
236 assert_equal(btwo, bufnr()) |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
237 edit %% # comment |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
238 assert_equal(bthree, bufnr()) |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
239 edit %%yy |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
240 assert_equal('Xfiletwoyy', bufname()) |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
241 |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
242 exe "edit %%" .. bone |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
243 assert_equal(bone, bufnr()) |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
244 exe "edit %%" .. btwo .. "xx" |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
245 assert_equal('Xfiletwoxx', bufname()) |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
246 |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
247 next Xfileone Xfiletwo Xfilethree |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
248 assert_equal('Xfileone', argv(0)) |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
249 assert_equal('Xfiletwo', argv(1)) |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
250 assert_equal('Xfilethree', argv(2)) |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
251 next %%%zz |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
252 assert_equal('Xfileone', argv(0)) |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
253 assert_equal('Xfiletwo', argv(1)) |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
254 assert_equal('Xfilethreezz', argv(2)) |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
255 |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
256 v:oldfiles = ['Xonefile', 'Xtwofile'] |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
257 edit %%<1 |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
258 assert_equal('Xonefile', bufname()) |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
259 edit %%<2 |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
260 assert_equal('Xtwofile', bufname()) |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
261 assert_fails('edit %%<3', 'E684:') |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
262 |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
263 edit Xfileone.vim |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
264 edit Xfiletwo |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
265 edit %%:r |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
266 assert_equal('Xfileone', bufname()) |
23711
29eccef07e2f
patch 8.2.2397: Vim9: "%%" not seen as alternate file name for ":bdel"
Bram Moolenaar <Bram@vim.org>
parents:
23709
diff
changeset
|
267 |
29eccef07e2f
patch 8.2.2397: Vim9: "%%" not seen as alternate file name for ":bdel"
Bram Moolenaar <Bram@vim.org>
parents:
23709
diff
changeset
|
268 assert_false(bufexists('altfoo')) |
29eccef07e2f
patch 8.2.2397: Vim9: "%%" not seen as alternate file name for ":bdel"
Bram Moolenaar <Bram@vim.org>
parents:
23709
diff
changeset
|
269 edit altfoo |
29eccef07e2f
patch 8.2.2397: Vim9: "%%" not seen as alternate file name for ":bdel"
Bram Moolenaar <Bram@vim.org>
parents:
23709
diff
changeset
|
270 edit bar |
29eccef07e2f
patch 8.2.2397: Vim9: "%%" not seen as alternate file name for ":bdel"
Bram Moolenaar <Bram@vim.org>
parents:
23709
diff
changeset
|
271 assert_true(bufexists('altfoo')) |
29eccef07e2f
patch 8.2.2397: Vim9: "%%" not seen as alternate file name for ":bdel"
Bram Moolenaar <Bram@vim.org>
parents:
23709
diff
changeset
|
272 assert_true(buflisted('altfoo')) |
29eccef07e2f
patch 8.2.2397: Vim9: "%%" not seen as alternate file name for ":bdel"
Bram Moolenaar <Bram@vim.org>
parents:
23709
diff
changeset
|
273 bdel %% |
29eccef07e2f
patch 8.2.2397: Vim9: "%%" not seen as alternate file name for ":bdel"
Bram Moolenaar <Bram@vim.org>
parents:
23709
diff
changeset
|
274 assert_true(bufexists('altfoo')) |
29eccef07e2f
patch 8.2.2397: Vim9: "%%" not seen as alternate file name for ":bdel"
Bram Moolenaar <Bram@vim.org>
parents:
23709
diff
changeset
|
275 assert_false(buflisted('altfoo')) |
29eccef07e2f
patch 8.2.2397: Vim9: "%%" not seen as alternate file name for ":bdel"
Bram Moolenaar <Bram@vim.org>
parents:
23709
diff
changeset
|
276 bwipe! altfoo |
29eccef07e2f
patch 8.2.2397: Vim9: "%%" not seen as alternate file name for ":bdel"
Bram Moolenaar <Bram@vim.org>
parents:
23709
diff
changeset
|
277 bwipe! bar |
23370
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
278 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
279 v9.CheckDefAndScriptSuccess(lines) |
23370
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
280 enddef |
622e90acea5d
patch 8.2.2228: Vim9: cannot use ":e #" because # starts a comment
Bram Moolenaar <Bram@vim.org>
parents:
23348
diff
changeset
|
281 |
23344
1f37fd20f851
patch 8.2.2215: Vim9: not recognized in global command
Bram Moolenaar <Bram@vim.org>
parents:
23274
diff
changeset
|
282 def Test_global_backtick_expansion() |
26358
80b555c4aed0
patch 8.2.3710: Vim9: backtick expression expanded for :global
Bram Moolenaar <Bram@vim.org>
parents:
26356
diff
changeset
|
283 var name = 'xxx' |
23344
1f37fd20f851
patch 8.2.2215: Vim9: not recognized in global command
Bram Moolenaar <Bram@vim.org>
parents:
23274
diff
changeset
|
284 new |
26358
80b555c4aed0
patch 8.2.3710: Vim9: backtick expression expanded for :global
Bram Moolenaar <Bram@vim.org>
parents:
26356
diff
changeset
|
285 setline(1, ['one', 'two', 'three']) |
80b555c4aed0
patch 8.2.3710: Vim9: backtick expression expanded for :global
Bram Moolenaar <Bram@vim.org>
parents:
26356
diff
changeset
|
286 set nomod |
80b555c4aed0
patch 8.2.3710: Vim9: backtick expression expanded for :global
Bram Moolenaar <Bram@vim.org>
parents:
26356
diff
changeset
|
287 g/two/edit `=name` |
80b555c4aed0
patch 8.2.3710: Vim9: backtick expression expanded for :global
Bram Moolenaar <Bram@vim.org>
parents:
26356
diff
changeset
|
288 assert_equal('xxx', bufname()) |
80b555c4aed0
patch 8.2.3710: Vim9: backtick expression expanded for :global
Bram Moolenaar <Bram@vim.org>
parents:
26356
diff
changeset
|
289 bwipe! |
80b555c4aed0
patch 8.2.3710: Vim9: backtick expression expanded for :global
Bram Moolenaar <Bram@vim.org>
parents:
26356
diff
changeset
|
290 |
80b555c4aed0
patch 8.2.3710: Vim9: backtick expression expanded for :global
Bram Moolenaar <Bram@vim.org>
parents:
26356
diff
changeset
|
291 new |
80b555c4aed0
patch 8.2.3710: Vim9: backtick expression expanded for :global
Bram Moolenaar <Bram@vim.org>
parents:
26356
diff
changeset
|
292 setline(1, ['one', 'two', 'three']) |
80b555c4aed0
patch 8.2.3710: Vim9: backtick expression expanded for :global
Bram Moolenaar <Bram@vim.org>
parents:
26356
diff
changeset
|
293 g/two/s/^/`=name`/ |
80b555c4aed0
patch 8.2.3710: Vim9: backtick expression expanded for :global
Bram Moolenaar <Bram@vim.org>
parents:
26356
diff
changeset
|
294 assert_equal('`=name`two', getline(2)) |
23344
1f37fd20f851
patch 8.2.2215: Vim9: not recognized in global command
Bram Moolenaar <Bram@vim.org>
parents:
23274
diff
changeset
|
295 bwipe! |
1f37fd20f851
patch 8.2.2215: Vim9: not recognized in global command
Bram Moolenaar <Bram@vim.org>
parents:
23274
diff
changeset
|
296 enddef |
1f37fd20f851
patch 8.2.2215: Vim9: not recognized in global command
Bram Moolenaar <Bram@vim.org>
parents:
23274
diff
changeset
|
297 |
23521
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
298 def Test_folddo_backtick_expansion() |
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
299 new |
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
300 var name = 'xxx' |
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
301 folddoopen edit `=name` |
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
302 assert_equal('xxx', bufname()) |
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
303 bwipe! |
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
304 |
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
305 new |
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
306 setline(1, ['one', 'two']) |
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
307 set nomodified |
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
308 :1,2fold |
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
309 foldclose |
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
310 folddoclose edit `=name` |
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
311 assert_equal('xxx', bufname()) |
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
312 bwipe! |
26356
0884f2be6c2a
patch 8.2.3709: Vim9: backtick expression expanded when not desired
Bram Moolenaar <Bram@vim.org>
parents:
26354
diff
changeset
|
313 |
0884f2be6c2a
patch 8.2.3709: Vim9: backtick expression expanded when not desired
Bram Moolenaar <Bram@vim.org>
parents:
26354
diff
changeset
|
314 var lines =<< trim END |
0884f2be6c2a
patch 8.2.3709: Vim9: backtick expression expanded when not desired
Bram Moolenaar <Bram@vim.org>
parents:
26354
diff
changeset
|
315 g:val = 'value' |
0884f2be6c2a
patch 8.2.3709: Vim9: backtick expression expanded when not desired
Bram Moolenaar <Bram@vim.org>
parents:
26354
diff
changeset
|
316 def Test() |
0884f2be6c2a
patch 8.2.3709: Vim9: backtick expression expanded when not desired
Bram Moolenaar <Bram@vim.org>
parents:
26354
diff
changeset
|
317 folddoopen echo `=g:val` |
0884f2be6c2a
patch 8.2.3709: Vim9: backtick expression expanded when not desired
Bram Moolenaar <Bram@vim.org>
parents:
26354
diff
changeset
|
318 enddef |
0884f2be6c2a
patch 8.2.3709: Vim9: backtick expression expanded when not desired
Bram Moolenaar <Bram@vim.org>
parents:
26354
diff
changeset
|
319 call Test() |
0884f2be6c2a
patch 8.2.3709: Vim9: backtick expression expanded when not desired
Bram Moolenaar <Bram@vim.org>
parents:
26354
diff
changeset
|
320 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
321 v9.CheckScriptFailure(lines, 'E15: Invalid expression: "`=g:val`"') |
23521
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
322 enddef |
0ef920a03380
patch 8.2.2303: Vim9: backtick expansion doesn't work for :foldopen
Bram Moolenaar <Bram@vim.org>
parents:
23513
diff
changeset
|
323 |
20172
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
324 def Test_hardcopy_wildcards() |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
325 CheckUnix |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
326 CheckFeature postscript |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
327 |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
328 var outfile = 'print' |
20172
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
329 hardcopy > X`=outfile`.ps |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
330 assert_true(filereadable('Xprint.ps')) |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
331 |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
332 delete('Xprint.ps') |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
333 enddef |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
334 |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
335 def Test_syn_include_wildcards() |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
336 writefile(['syn keyword Found found'], 'Xthemine.vim') |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
337 var save_rtp = &rtp |
20172
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
338 &rtp = '.' |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
339 |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
340 var fname = 'mine' |
20172
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
341 syn include @Group Xthe`=fname`.vim |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
342 assert_match('Found.* contained found', execute('syn list Found')) |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
343 |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
344 &rtp = save_rtp |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
345 delete('Xthemine.vim') |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
346 enddef |
1d84eaed0ec8
patch 8.2.0641: Vim9: not expanded in :hardcopy and syn-include
Bram Moolenaar <Bram@vim.org>
parents:
20170
diff
changeset
|
347 |
21048
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
348 def Test_echo_linebreak() |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
349 var lines =<< trim END |
21048
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
350 vim9script |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
351 redir @a |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
352 echo 'one' |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
353 .. 'two' |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
354 redir END |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
355 assert_equal("\nonetwo", @a) |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
356 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
357 v9.CheckScriptSuccess(lines) |
21048
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
358 |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
359 lines =<< trim END |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
360 vim9script |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
361 redir @a |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
362 echo 11 + |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
363 77 |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
364 - 22 |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
365 redir END |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
366 assert_equal("\n66", @a) |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
367 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
368 v9.CheckScriptSuccess(lines) |
21048
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
369 enddef |
524fa1d42e1e
patch 8.2.1075: Vim9: no line break allowed in :echo expression
Bram Moolenaar <Bram@vim.org>
parents:
20353
diff
changeset
|
370 |
22500
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
371 def Test_condition_types() |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
372 var lines =<< trim END |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
373 if 'text' |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
374 endif |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
375 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
376 v9.CheckDefAndScriptFailure(lines, 'E1135:', 1) |
22500
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
377 |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
378 lines =<< trim END |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
379 if [1] |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
380 endif |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
381 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
382 v9.CheckDefFailure(lines, 'E1012:', 1) |
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
383 v9.CheckScriptFailure(['vim9script'] + lines, 'E745:', 2) |
22500
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
384 |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
385 lines =<< trim END |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
386 g:cond = 'text' |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
387 if g:cond |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
388 endif |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
389 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
390 v9.CheckDefExecAndScriptFailure(lines, 'E1135:', 2) |
22500
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
391 |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
392 lines =<< trim END |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
393 g:cond = 0 |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
394 if g:cond |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
395 elseif 'text' |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
396 endif |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
397 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
398 v9.CheckDefAndScriptFailure(lines, 'E1135:', 3) |
22500
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
399 |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
400 lines =<< trim END |
26360
a5dac0a9aa5f
patch 8.2.3711: Vim9: memory leak when compiling :elseif fails
Bram Moolenaar <Bram@vim.org>
parents:
26358
diff
changeset
|
401 g:cond = 0 |
a5dac0a9aa5f
patch 8.2.3711: Vim9: memory leak when compiling :elseif fails
Bram Moolenaar <Bram@vim.org>
parents:
26358
diff
changeset
|
402 if g:cond |
a5dac0a9aa5f
patch 8.2.3711: Vim9: memory leak when compiling :elseif fails
Bram Moolenaar <Bram@vim.org>
parents:
26358
diff
changeset
|
403 elseif 'text' garbage |
a5dac0a9aa5f
patch 8.2.3711: Vim9: memory leak when compiling :elseif fails
Bram Moolenaar <Bram@vim.org>
parents:
26358
diff
changeset
|
404 endif |
a5dac0a9aa5f
patch 8.2.3711: Vim9: memory leak when compiling :elseif fails
Bram Moolenaar <Bram@vim.org>
parents:
26358
diff
changeset
|
405 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
406 v9.CheckDefAndScriptFailure(lines, 'E488:', 3) |
26360
a5dac0a9aa5f
patch 8.2.3711: Vim9: memory leak when compiling :elseif fails
Bram Moolenaar <Bram@vim.org>
parents:
26358
diff
changeset
|
407 |
a5dac0a9aa5f
patch 8.2.3711: Vim9: memory leak when compiling :elseif fails
Bram Moolenaar <Bram@vim.org>
parents:
26358
diff
changeset
|
408 lines =<< trim END |
a5dac0a9aa5f
patch 8.2.3711: Vim9: memory leak when compiling :elseif fails
Bram Moolenaar <Bram@vim.org>
parents:
26358
diff
changeset
|
409 g:cond = 0 |
22500
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
410 if g:cond |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
411 elseif [1] |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
412 endif |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
413 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
414 v9.CheckDefFailure(lines, 'E1012:', 3) |
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
415 v9.CheckScriptFailure(['vim9script'] + lines, 'E745:', 4) |
22500
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
416 |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
417 lines =<< trim END |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
418 g:cond = 'text' |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
419 if 0 |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
420 elseif g:cond |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
421 endif |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
422 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
423 v9.CheckDefExecAndScriptFailure(lines, 'E1135:', 3) |
22500
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
424 |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
425 lines =<< trim END |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
426 while 'text' |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
427 endwhile |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
428 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
429 v9.CheckDefFailure(lines, 'E1012:', 1) |
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
430 v9.CheckScriptFailure(['vim9script'] + lines, 'E1135:', 2) |
22500
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
431 |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
432 lines =<< trim END |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
433 while [1] |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
434 endwhile |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
435 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
436 v9.CheckDefFailure(lines, 'E1012:', 1) |
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
437 v9.CheckScriptFailure(['vim9script'] + lines, 'E745:', 2) |
22500
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
438 |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
439 lines =<< trim END |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
440 g:cond = 'text' |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
441 while g:cond |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
442 endwhile |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
443 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
444 v9.CheckDefExecAndScriptFailure(lines, 'E1135:', 2) |
22500
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
445 enddef |
ef8a3177edc1
patch 8.2.1798: Vim9: trinary operator condition is too permissive
Bram Moolenaar <Bram@vim.org>
parents:
22494
diff
changeset
|
446 |
21050
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
447 def Test_if_linebreak() |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
448 var lines =<< trim END |
21050
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
449 vim9script |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
450 if 1 && |
22494
4c21f7f6f9e3
patch 8.2.1795: Vim9: operators && and || have a confusing result
Bram Moolenaar <Bram@vim.org>
parents:
22435
diff
changeset
|
451 true |
4c21f7f6f9e3
patch 8.2.1795: Vim9: operators && and || have a confusing result
Bram Moolenaar <Bram@vim.org>
parents:
22435
diff
changeset
|
452 || 1 |
21050
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
453 g:res = 42 |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
454 endif |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
455 assert_equal(42, g:res) |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
456 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
457 v9.CheckScriptSuccess(lines) |
21050
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
458 unlet g:res |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
459 |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
460 lines =<< trim END |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
461 vim9script |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
462 if 1 && |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
463 0 |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
464 g:res = 0 |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
465 elseif 0 || |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
466 0 |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
467 || 1 |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
468 g:res = 12 |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
469 endif |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
470 assert_equal(12, g:res) |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
471 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
472 v9.CheckScriptSuccess(lines) |
21050
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
473 unlet g:res |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
474 enddef |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
475 |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
476 def Test_while_linebreak() |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
477 var lines =<< trim END |
21050
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
478 vim9script |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
479 var nr = 0 |
21056
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
480 while nr < |
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
481 10 + 3 |
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
482 nr = nr |
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
483 + 4 |
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
484 endwhile |
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
485 assert_equal(16, nr) |
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
486 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
487 v9.CheckScriptSuccess(lines) |
21056
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
488 |
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
489 lines =<< trim END |
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
490 vim9script |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
491 var nr = 0 |
21056
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
492 while nr |
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
493 < |
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
494 10 |
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
495 + |
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
496 3 |
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
497 nr = nr |
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
498 + |
a7c202f5cbe9
patch 8.2.1079: Vim9: no line break allowed in a while loop
Bram Moolenaar <Bram@vim.org>
parents:
21050
diff
changeset
|
499 4 |
21050
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
500 endwhile |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
501 assert_equal(16, nr) |
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
502 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
503 v9.CheckScriptSuccess(lines) |
21050
7a9daf73a724
patch 8.2.1076: Vim9: no line break allowed in :if expression
Bram Moolenaar <Bram@vim.org>
parents:
21048
diff
changeset
|
504 enddef |
20170
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
505 |
21058
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
506 def Test_for_linebreak() |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
507 var lines =<< trim END |
21058
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
508 vim9script |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
509 var nr = 0 |
21058
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
510 for x |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
511 in |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
512 [1, 2, 3, 4] |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
513 nr = nr + x |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
514 endfor |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
515 assert_equal(10, nr) |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
516 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
517 v9.CheckScriptSuccess(lines) |
21058
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
518 |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
519 lines =<< trim END |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
520 vim9script |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
521 var nr = 0 |
21058
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
522 for x |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
523 in |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
524 [1, 2, |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
525 3, 4 |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
526 ] |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
527 nr = nr |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
528 + |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
529 x |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
530 endfor |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
531 assert_equal(10, nr) |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
532 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
533 v9.CheckScriptSuccess(lines) |
21058
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
534 enddef |
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
535 |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
536 def s:MethodAfterLinebreak(arg: string) |
23966
09bde146adcb
patch 8.2.2525: Vim9: only local variables checked for a name
Bram Moolenaar <Bram@vim.org>
parents:
23938
diff
changeset
|
537 arg |
09bde146adcb
patch 8.2.2525: Vim9: only local variables checked for a name
Bram Moolenaar <Bram@vim.org>
parents:
23938
diff
changeset
|
538 ->setline(1) |
09bde146adcb
patch 8.2.2525: Vim9: only local variables checked for a name
Bram Moolenaar <Bram@vim.org>
parents:
23938
diff
changeset
|
539 enddef |
09bde146adcb
patch 8.2.2525: Vim9: only local variables checked for a name
Bram Moolenaar <Bram@vim.org>
parents:
23938
diff
changeset
|
540 |
21130
4a1e8086759b
patch 8.2.1116: Vim9: parsing command checks for list twice
Bram Moolenaar <Bram@vim.org>
parents:
21122
diff
changeset
|
541 def Test_method_call_linebreak() |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
542 var lines =<< trim END |
21122
839ace6773aa
patch 8.2.1112: Vim9: no line continuation allowed in method call
Bram Moolenaar <Bram@vim.org>
parents:
21058
diff
changeset
|
543 vim9script |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
544 var res = [] |
21122
839ace6773aa
patch 8.2.1112: Vim9: no line continuation allowed in method call
Bram Moolenaar <Bram@vim.org>
parents:
21058
diff
changeset
|
545 func RetArg( |
839ace6773aa
patch 8.2.1112: Vim9: no line continuation allowed in method call
Bram Moolenaar <Bram@vim.org>
parents:
21058
diff
changeset
|
546 arg |
839ace6773aa
patch 8.2.1112: Vim9: no line continuation allowed in method call
Bram Moolenaar <Bram@vim.org>
parents:
21058
diff
changeset
|
547 ) |
839ace6773aa
patch 8.2.1112: Vim9: no line continuation allowed in method call
Bram Moolenaar <Bram@vim.org>
parents:
21058
diff
changeset
|
548 let s:res = a:arg |
839ace6773aa
patch 8.2.1112: Vim9: no line continuation allowed in method call
Bram Moolenaar <Bram@vim.org>
parents:
21058
diff
changeset
|
549 endfunc |
839ace6773aa
patch 8.2.1112: Vim9: no line continuation allowed in method call
Bram Moolenaar <Bram@vim.org>
parents:
21058
diff
changeset
|
550 [1, |
839ace6773aa
patch 8.2.1112: Vim9: no line continuation allowed in method call
Bram Moolenaar <Bram@vim.org>
parents:
21058
diff
changeset
|
551 2, |
839ace6773aa
patch 8.2.1112: Vim9: no line continuation allowed in method call
Bram Moolenaar <Bram@vim.org>
parents:
21058
diff
changeset
|
552 3]->RetArg() |
839ace6773aa
patch 8.2.1112: Vim9: no line continuation allowed in method call
Bram Moolenaar <Bram@vim.org>
parents:
21058
diff
changeset
|
553 assert_equal([1, 2, 3], res) |
839ace6773aa
patch 8.2.1112: Vim9: no line continuation allowed in method call
Bram Moolenaar <Bram@vim.org>
parents:
21058
diff
changeset
|
554 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
555 v9.CheckScriptSuccess(lines) |
23823
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
556 |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
557 lines =<< trim END |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
558 new |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
559 var name = [1, 2] |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
560 name |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
561 ->copy() |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
562 ->setline(1) |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
563 assert_equal(['1', '2'], getline(1, 2)) |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
564 bwipe! |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
565 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
566 v9.CheckDefAndScriptSuccess(lines) |
23823
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
567 |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
568 lines =<< trim END |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
569 new |
24067
780dec2ffa6b
patch 8.2.2575: Vim9: a function name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
24049
diff
changeset
|
570 def Foo(): string |
780dec2ffa6b
patch 8.2.2575: Vim9: a function name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
24049
diff
changeset
|
571 return 'the text' |
780dec2ffa6b
patch 8.2.2575: Vim9: a function name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
24049
diff
changeset
|
572 enddef |
780dec2ffa6b
patch 8.2.2575: Vim9: a function name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
24049
diff
changeset
|
573 def Bar(F: func): string |
780dec2ffa6b
patch 8.2.2575: Vim9: a function name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
24049
diff
changeset
|
574 return F() |
780dec2ffa6b
patch 8.2.2575: Vim9: a function name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
24049
diff
changeset
|
575 enddef |
780dec2ffa6b
patch 8.2.2575: Vim9: a function name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
24049
diff
changeset
|
576 def Test() |
24124
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
577 Foo ->Bar() |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
578 ->setline(1) |
24067
780dec2ffa6b
patch 8.2.2575: Vim9: a function name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
24049
diff
changeset
|
579 enddef |
780dec2ffa6b
patch 8.2.2575: Vim9: a function name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
24049
diff
changeset
|
580 Test() |
780dec2ffa6b
patch 8.2.2575: Vim9: a function name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
24049
diff
changeset
|
581 assert_equal('the text', getline(1)) |
780dec2ffa6b
patch 8.2.2575: Vim9: a function name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
24049
diff
changeset
|
582 bwipe! |
780dec2ffa6b
patch 8.2.2575: Vim9: a function name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
24049
diff
changeset
|
583 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
584 v9.CheckDefAndScriptSuccess(lines) |
24067
780dec2ffa6b
patch 8.2.2575: Vim9: a function name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
24049
diff
changeset
|
585 |
780dec2ffa6b
patch 8.2.2575: Vim9: a function name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
24049
diff
changeset
|
586 lines =<< trim END |
780dec2ffa6b
patch 8.2.2575: Vim9: a function name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
24049
diff
changeset
|
587 new |
23823
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
588 g:shortlist |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
589 ->copy() |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
590 ->setline(1) |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
591 assert_equal(['1', '2'], getline(1, 2)) |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
592 bwipe! |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
593 END |
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
594 g:shortlist = [1, 2] |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
595 v9.CheckDefAndScriptSuccess(lines) |
23823
262ab14b27db
patch 8.2.2453: Vim9: a variable name with "->" in the next line doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
23711
diff
changeset
|
596 unlet g:shortlist |
23966
09bde146adcb
patch 8.2.2525: Vim9: only local variables checked for a name
Bram Moolenaar <Bram@vim.org>
parents:
23938
diff
changeset
|
597 |
09bde146adcb
patch 8.2.2525: Vim9: only local variables checked for a name
Bram Moolenaar <Bram@vim.org>
parents:
23938
diff
changeset
|
598 new |
09bde146adcb
patch 8.2.2525: Vim9: only local variables checked for a name
Bram Moolenaar <Bram@vim.org>
parents:
23938
diff
changeset
|
599 MethodAfterLinebreak('foobar') |
09bde146adcb
patch 8.2.2525: Vim9: only local variables checked for a name
Bram Moolenaar <Bram@vim.org>
parents:
23938
diff
changeset
|
600 assert_equal('foobar', getline(1)) |
09bde146adcb
patch 8.2.2525: Vim9: only local variables checked for a name
Bram Moolenaar <Bram@vim.org>
parents:
23938
diff
changeset
|
601 bwipe! |
24049
fc4c2beea99a
patch 8.2.2566: Vim9: Function name is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
23966
diff
changeset
|
602 |
fc4c2beea99a
patch 8.2.2566: Vim9: Function name is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
23966
diff
changeset
|
603 lines =<< trim END |
fc4c2beea99a
patch 8.2.2566: Vim9: Function name is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
23966
diff
changeset
|
604 vim9script |
fc4c2beea99a
patch 8.2.2566: Vim9: Function name is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
23966
diff
changeset
|
605 def Foo(): string |
fc4c2beea99a
patch 8.2.2566: Vim9: Function name is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
23966
diff
changeset
|
606 return '# some text' |
fc4c2beea99a
patch 8.2.2566: Vim9: Function name is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
23966
diff
changeset
|
607 enddef |
fc4c2beea99a
patch 8.2.2566: Vim9: Function name is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
23966
diff
changeset
|
608 |
fc4c2beea99a
patch 8.2.2566: Vim9: Function name is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
23966
diff
changeset
|
609 def Bar(F: func): string |
fc4c2beea99a
patch 8.2.2566: Vim9: Function name is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
23966
diff
changeset
|
610 return F() |
fc4c2beea99a
patch 8.2.2566: Vim9: Function name is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
23966
diff
changeset
|
611 enddef |
fc4c2beea99a
patch 8.2.2566: Vim9: Function name is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
23966
diff
changeset
|
612 |
24124
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
613 Foo->Bar() |
24049
fc4c2beea99a
patch 8.2.2566: Vim9: Function name is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
23966
diff
changeset
|
614 ->setline(1) |
fc4c2beea99a
patch 8.2.2566: Vim9: Function name is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
23966
diff
changeset
|
615 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
616 v9.CheckScriptSuccess(lines) |
24049
fc4c2beea99a
patch 8.2.2566: Vim9: Function name is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
23966
diff
changeset
|
617 assert_equal('# some text', getline(1)) |
fc4c2beea99a
patch 8.2.2566: Vim9: Function name is not recognized
Bram Moolenaar <Bram@vim.org>
parents:
23966
diff
changeset
|
618 bwipe! |
21122
839ace6773aa
patch 8.2.1112: Vim9: no line continuation allowed in method call
Bram Moolenaar <Bram@vim.org>
parents:
21058
diff
changeset
|
619 enddef |
839ace6773aa
patch 8.2.1112: Vim9: no line continuation allowed in method call
Bram Moolenaar <Bram@vim.org>
parents:
21058
diff
changeset
|
620 |
23709
a0c4d04a58c4
patch 8.2.2396: Vim9: no white space allowed before "->"
Bram Moolenaar <Bram@vim.org>
parents:
23671
diff
changeset
|
621 def Test_method_call_whitespace() |
a0c4d04a58c4
patch 8.2.2396: Vim9: no white space allowed before "->"
Bram Moolenaar <Bram@vim.org>
parents:
23671
diff
changeset
|
622 var lines =<< trim END |
a0c4d04a58c4
patch 8.2.2396: Vim9: no white space allowed before "->"
Bram Moolenaar <Bram@vim.org>
parents:
23671
diff
changeset
|
623 new |
a0c4d04a58c4
patch 8.2.2396: Vim9: no white space allowed before "->"
Bram Moolenaar <Bram@vim.org>
parents:
23671
diff
changeset
|
624 var yank = 'text' |
a0c4d04a58c4
patch 8.2.2396: Vim9: no white space allowed before "->"
Bram Moolenaar <Bram@vim.org>
parents:
23671
diff
changeset
|
625 yank->setline(1) |
a0c4d04a58c4
patch 8.2.2396: Vim9: no white space allowed before "->"
Bram Moolenaar <Bram@vim.org>
parents:
23671
diff
changeset
|
626 yank ->setline(2) |
a0c4d04a58c4
patch 8.2.2396: Vim9: no white space allowed before "->"
Bram Moolenaar <Bram@vim.org>
parents:
23671
diff
changeset
|
627 yank-> setline(3) |
a0c4d04a58c4
patch 8.2.2396: Vim9: no white space allowed before "->"
Bram Moolenaar <Bram@vim.org>
parents:
23671
diff
changeset
|
628 yank -> setline(4) |
a0c4d04a58c4
patch 8.2.2396: Vim9: no white space allowed before "->"
Bram Moolenaar <Bram@vim.org>
parents:
23671
diff
changeset
|
629 assert_equal(['text', 'text', 'text', 'text'], getline(1, 4)) |
a0c4d04a58c4
patch 8.2.2396: Vim9: no white space allowed before "->"
Bram Moolenaar <Bram@vim.org>
parents:
23671
diff
changeset
|
630 bwipe! |
a0c4d04a58c4
patch 8.2.2396: Vim9: no white space allowed before "->"
Bram Moolenaar <Bram@vim.org>
parents:
23671
diff
changeset
|
631 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
632 v9.CheckDefAndScriptSuccess(lines) |
23709
a0c4d04a58c4
patch 8.2.2396: Vim9: no white space allowed before "->"
Bram Moolenaar <Bram@vim.org>
parents:
23671
diff
changeset
|
633 enddef |
a0c4d04a58c4
patch 8.2.2396: Vim9: no white space allowed before "->"
Bram Moolenaar <Bram@vim.org>
parents:
23671
diff
changeset
|
634 |
24124
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
635 def Test_method_and_user_command() |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
636 var lines =<< trim END |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
637 vim9script |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
638 def Cmd() |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
639 g:didFunc = 1 |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
640 enddef |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
641 command Cmd g:didCmd = 1 |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
642 Cmd |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
643 assert_equal(1, g:didCmd) |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
644 Cmd() |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
645 assert_equal(1, g:didFunc) |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
646 unlet g:didFunc |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
647 unlet g:didCmd |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
648 |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
649 def InDefFunc() |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
650 Cmd |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
651 assert_equal(1, g:didCmd) |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
652 Cmd() |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
653 assert_equal(1, g:didFunc) |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
654 unlet g:didFunc |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
655 unlet g:didCmd |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
656 enddef |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
657 InDefFunc() |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
658 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
659 v9.CheckScriptSuccess(lines) |
24124
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
660 enddef |
f4061617c438
patch 8.2.2603: Vim9: no effect if user command is also a function
Bram Moolenaar <Bram@vim.org>
parents:
24067
diff
changeset
|
661 |
25658
483b40e87ca5
patch 8.2.3365: Vim9: cannot use option for all operations
Bram Moolenaar <Bram@vim.org>
parents:
25622
diff
changeset
|
662 def Test_option_use_linebreak() |
483b40e87ca5
patch 8.2.3365: Vim9: cannot use option for all operations
Bram Moolenaar <Bram@vim.org>
parents:
25622
diff
changeset
|
663 var lines =<< trim END |
483b40e87ca5
patch 8.2.3365: Vim9: cannot use option for all operations
Bram Moolenaar <Bram@vim.org>
parents:
25622
diff
changeset
|
664 new |
483b40e87ca5
patch 8.2.3365: Vim9: cannot use option for all operations
Bram Moolenaar <Bram@vim.org>
parents:
25622
diff
changeset
|
665 &matchpairs = '(:)' |
483b40e87ca5
patch 8.2.3365: Vim9: cannot use option for all operations
Bram Moolenaar <Bram@vim.org>
parents:
25622
diff
changeset
|
666 &matchpairs->setline(1) |
483b40e87ca5
patch 8.2.3365: Vim9: cannot use option for all operations
Bram Moolenaar <Bram@vim.org>
parents:
25622
diff
changeset
|
667 &matchpairs = '[:]' |
483b40e87ca5
patch 8.2.3365: Vim9: cannot use option for all operations
Bram Moolenaar <Bram@vim.org>
parents:
25622
diff
changeset
|
668 &matchpairs ->setline(2) |
483b40e87ca5
patch 8.2.3365: Vim9: cannot use option for all operations
Bram Moolenaar <Bram@vim.org>
parents:
25622
diff
changeset
|
669 &matchpairs = '{:}' |
483b40e87ca5
patch 8.2.3365: Vim9: cannot use option for all operations
Bram Moolenaar <Bram@vim.org>
parents:
25622
diff
changeset
|
670 &matchpairs |
483b40e87ca5
patch 8.2.3365: Vim9: cannot use option for all operations
Bram Moolenaar <Bram@vim.org>
parents:
25622
diff
changeset
|
671 ->setline(3) |
483b40e87ca5
patch 8.2.3365: Vim9: cannot use option for all operations
Bram Moolenaar <Bram@vim.org>
parents:
25622
diff
changeset
|
672 assert_equal(['(:)', '[:]', '{:}'], getline(1, '$')) |
483b40e87ca5
patch 8.2.3365: Vim9: cannot use option for all operations
Bram Moolenaar <Bram@vim.org>
parents:
25622
diff
changeset
|
673 bwipe! |
483b40e87ca5
patch 8.2.3365: Vim9: cannot use option for all operations
Bram Moolenaar <Bram@vim.org>
parents:
25622
diff
changeset
|
674 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
675 v9.CheckDefAndScriptSuccess(lines) |
25658
483b40e87ca5
patch 8.2.3365: Vim9: cannot use option for all operations
Bram Moolenaar <Bram@vim.org>
parents:
25622
diff
changeset
|
676 enddef |
483b40e87ca5
patch 8.2.3365: Vim9: cannot use option for all operations
Bram Moolenaar <Bram@vim.org>
parents:
25622
diff
changeset
|
677 |
25680
8556ded8a462
patch 8.2.3376: Vim9: no warning that "@r" does not do anything
Bram Moolenaar <Bram@vim.org>
parents:
25670
diff
changeset
|
678 def Test_use_register() |
25662
23f065f27d2e
patch 8.2.3367: Vim9: :@r executing a register is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
25658
diff
changeset
|
679 var lines =<< trim END |
23f065f27d2e
patch 8.2.3367: Vim9: :@r executing a register is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
25658
diff
changeset
|
680 new |
23f065f27d2e
patch 8.2.3367: Vim9: :@r executing a register is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
25658
diff
changeset
|
681 @a = 'one' |
23f065f27d2e
patch 8.2.3367: Vim9: :@r executing a register is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
25658
diff
changeset
|
682 @a->setline(1) |
23f065f27d2e
patch 8.2.3367: Vim9: :@r executing a register is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
25658
diff
changeset
|
683 @b = 'two' |
23f065f27d2e
patch 8.2.3367: Vim9: :@r executing a register is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
25658
diff
changeset
|
684 @b ->setline(2) |
23f065f27d2e
patch 8.2.3367: Vim9: :@r executing a register is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
25658
diff
changeset
|
685 @c = 'three' |
23f065f27d2e
patch 8.2.3367: Vim9: :@r executing a register is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
25658
diff
changeset
|
686 @c |
23f065f27d2e
patch 8.2.3367: Vim9: :@r executing a register is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
25658
diff
changeset
|
687 ->setline(3) |
23f065f27d2e
patch 8.2.3367: Vim9: :@r executing a register is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
25658
diff
changeset
|
688 assert_equal(['one', 'two', 'three'], getline(1, '$')) |
23f065f27d2e
patch 8.2.3367: Vim9: :@r executing a register is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
25658
diff
changeset
|
689 bwipe! |
23f065f27d2e
patch 8.2.3367: Vim9: :@r executing a register is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
25658
diff
changeset
|
690 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
691 v9.CheckDefAndScriptSuccess(lines) |
25680
8556ded8a462
patch 8.2.3376: Vim9: no warning that "@r" does not do anything
Bram Moolenaar <Bram@vim.org>
parents:
25670
diff
changeset
|
692 |
8556ded8a462
patch 8.2.3376: Vim9: no warning that "@r" does not do anything
Bram Moolenaar <Bram@vim.org>
parents:
25670
diff
changeset
|
693 lines =<< trim END |
8556ded8a462
patch 8.2.3376: Vim9: no warning that "@r" does not do anything
Bram Moolenaar <Bram@vim.org>
parents:
25670
diff
changeset
|
694 @a = 'echo "text"' |
8556ded8a462
patch 8.2.3376: Vim9: no warning that "@r" does not do anything
Bram Moolenaar <Bram@vim.org>
parents:
25670
diff
changeset
|
695 @a |
8556ded8a462
patch 8.2.3376: Vim9: no warning that "@r" does not do anything
Bram Moolenaar <Bram@vim.org>
parents:
25670
diff
changeset
|
696 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
697 v9.CheckDefAndScriptFailure(lines, 'E1207:', 2) |
26228
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
698 |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
699 lines =<< trim END |
28696
a090c60278f5
patch 8.2.4872: Vim9: no error for using an expression only
Bram Moolenaar <Bram@vim.org>
parents:
28623
diff
changeset
|
700 @a = 'echo "text"' |
a090c60278f5
patch 8.2.4872: Vim9: no error for using an expression only
Bram Moolenaar <Bram@vim.org>
parents:
28623
diff
changeset
|
701 @a |
a090c60278f5
patch 8.2.4872: Vim9: no error for using an expression only
Bram Moolenaar <Bram@vim.org>
parents:
28623
diff
changeset
|
702 |
a090c60278f5
patch 8.2.4872: Vim9: no error for using an expression only
Bram Moolenaar <Bram@vim.org>
parents:
28623
diff
changeset
|
703 END |
a090c60278f5
patch 8.2.4872: Vim9: no error for using an expression only
Bram Moolenaar <Bram@vim.org>
parents:
28623
diff
changeset
|
704 v9.CheckDefAndScriptFailure(lines, 'E1207:', 2) |
a090c60278f5
patch 8.2.4872: Vim9: no error for using an expression only
Bram Moolenaar <Bram@vim.org>
parents:
28623
diff
changeset
|
705 |
a090c60278f5
patch 8.2.4872: Vim9: no error for using an expression only
Bram Moolenaar <Bram@vim.org>
parents:
28623
diff
changeset
|
706 lines =<< trim END |
a090c60278f5
patch 8.2.4872: Vim9: no error for using an expression only
Bram Moolenaar <Bram@vim.org>
parents:
28623
diff
changeset
|
707 @a = 'echo "text"' |
a090c60278f5
patch 8.2.4872: Vim9: no error for using an expression only
Bram Moolenaar <Bram@vim.org>
parents:
28623
diff
changeset
|
708 @a |
a090c60278f5
patch 8.2.4872: Vim9: no error for using an expression only
Bram Moolenaar <Bram@vim.org>
parents:
28623
diff
changeset
|
709 # comment |
a090c60278f5
patch 8.2.4872: Vim9: no error for using an expression only
Bram Moolenaar <Bram@vim.org>
parents:
28623
diff
changeset
|
710 END |
a090c60278f5
patch 8.2.4872: Vim9: no error for using an expression only
Bram Moolenaar <Bram@vim.org>
parents:
28623
diff
changeset
|
711 v9.CheckDefAndScriptFailure(lines, 'E1207:', 2) |
a090c60278f5
patch 8.2.4872: Vim9: no error for using an expression only
Bram Moolenaar <Bram@vim.org>
parents:
28623
diff
changeset
|
712 |
a090c60278f5
patch 8.2.4872: Vim9: no error for using an expression only
Bram Moolenaar <Bram@vim.org>
parents:
28623
diff
changeset
|
713 lines =<< trim END |
26228
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
714 @/ = 'pattern' |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
715 @/ |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
716 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
717 v9.CheckDefAndScriptFailure(lines, 'E1207:', 2) |
26228
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
718 |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
719 lines =<< trim END |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
720 &opfunc = 'nothing' |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
721 &opfunc |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
722 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
723 v9.CheckDefAndScriptFailure(lines, 'E1207:', 2) |
26228
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
724 &opfunc = '' |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
725 |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
726 lines =<< trim END |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
727 &l:showbreak = 'nothing' |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
728 &l:showbreak |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
729 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
730 v9.CheckDefAndScriptFailure(lines, 'E1207:', 2) |
26228
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
731 &l:showbreak = '' |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
732 |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
733 lines =<< trim END |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
734 &g:showbreak = 'nothing' |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
735 &g:showbreak |
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
736 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
737 v9.CheckDefAndScriptFailure(lines, 'E1207:', 2) |
26228
269ecc6d69bc
patch 8.2.3645: Vim9: The "no effect" error is not given for all registers
Bram Moolenaar <Bram@vim.org>
parents:
26199
diff
changeset
|
738 &g:showbreak = '' |
26250
3711e56f7e7b
patch 8.2.3656: Vim9: no error for an evironment variable by itself
Bram Moolenaar <Bram@vim.org>
parents:
26240
diff
changeset
|
739 |
3711e56f7e7b
patch 8.2.3656: Vim9: no error for an evironment variable by itself
Bram Moolenaar <Bram@vim.org>
parents:
26240
diff
changeset
|
740 lines =<< trim END |
3711e56f7e7b
patch 8.2.3656: Vim9: no error for an evironment variable by itself
Bram Moolenaar <Bram@vim.org>
parents:
26240
diff
changeset
|
741 $SomeEnv = 'value' |
3711e56f7e7b
patch 8.2.3656: Vim9: no error for an evironment variable by itself
Bram Moolenaar <Bram@vim.org>
parents:
26240
diff
changeset
|
742 $SomeEnv |
3711e56f7e7b
patch 8.2.3656: Vim9: no error for an evironment variable by itself
Bram Moolenaar <Bram@vim.org>
parents:
26240
diff
changeset
|
743 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
744 v9.CheckDefAndScriptFailure(lines, 'E1207:', 2) |
26250
3711e56f7e7b
patch 8.2.3656: Vim9: no error for an evironment variable by itself
Bram Moolenaar <Bram@vim.org>
parents:
26240
diff
changeset
|
745 $SomeEnv = '' |
28895
228154db3ce6
patch 8.2.4970: "eval 123" gives an error, "eval 'abc'" does not
Bram Moolenaar <Bram@vim.org>
parents:
28696
diff
changeset
|
746 |
228154db3ce6
patch 8.2.4970: "eval 123" gives an error, "eval 'abc'" does not
Bram Moolenaar <Bram@vim.org>
parents:
28696
diff
changeset
|
747 lines =<< trim END |
228154db3ce6
patch 8.2.4970: "eval 123" gives an error, "eval 'abc'" does not
Bram Moolenaar <Bram@vim.org>
parents:
28696
diff
changeset
|
748 eval 'value' |
228154db3ce6
patch 8.2.4970: "eval 123" gives an error, "eval 'abc'" does not
Bram Moolenaar <Bram@vim.org>
parents:
28696
diff
changeset
|
749 END |
228154db3ce6
patch 8.2.4970: "eval 123" gives an error, "eval 'abc'" does not
Bram Moolenaar <Bram@vim.org>
parents:
28696
diff
changeset
|
750 v9.CheckDefAndScriptFailure(lines, 'E1207:', 1) |
228154db3ce6
patch 8.2.4970: "eval 123" gives an error, "eval 'abc'" does not
Bram Moolenaar <Bram@vim.org>
parents:
28696
diff
changeset
|
751 |
228154db3ce6
patch 8.2.4970: "eval 123" gives an error, "eval 'abc'" does not
Bram Moolenaar <Bram@vim.org>
parents:
28696
diff
changeset
|
752 lines =<< trim END |
228154db3ce6
patch 8.2.4970: "eval 123" gives an error, "eval 'abc'" does not
Bram Moolenaar <Bram@vim.org>
parents:
28696
diff
changeset
|
753 eval "value" |
228154db3ce6
patch 8.2.4970: "eval 123" gives an error, "eval 'abc'" does not
Bram Moolenaar <Bram@vim.org>
parents:
28696
diff
changeset
|
754 END |
228154db3ce6
patch 8.2.4970: "eval 123" gives an error, "eval 'abc'" does not
Bram Moolenaar <Bram@vim.org>
parents:
28696
diff
changeset
|
755 v9.CheckDefAndScriptFailure(lines, 'E1207:', 1) |
25662
23f065f27d2e
patch 8.2.3367: Vim9: :@r executing a register is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
25658
diff
changeset
|
756 enddef |
23f065f27d2e
patch 8.2.3367: Vim9: :@r executing a register is inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
25658
diff
changeset
|
757 |
25670
812c75fd255c
patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Bram Moolenaar <Bram@vim.org>
parents:
25662
diff
changeset
|
758 def Test_environment_use_linebreak() |
812c75fd255c
patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Bram Moolenaar <Bram@vim.org>
parents:
25662
diff
changeset
|
759 var lines =<< trim END |
812c75fd255c
patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Bram Moolenaar <Bram@vim.org>
parents:
25662
diff
changeset
|
760 new |
812c75fd255c
patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Bram Moolenaar <Bram@vim.org>
parents:
25662
diff
changeset
|
761 $TESTENV = 'one' |
812c75fd255c
patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Bram Moolenaar <Bram@vim.org>
parents:
25662
diff
changeset
|
762 $TESTENV->setline(1) |
812c75fd255c
patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Bram Moolenaar <Bram@vim.org>
parents:
25662
diff
changeset
|
763 $TESTENV = 'two' |
812c75fd255c
patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Bram Moolenaar <Bram@vim.org>
parents:
25662
diff
changeset
|
764 $TESTENV ->setline(2) |
812c75fd255c
patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Bram Moolenaar <Bram@vim.org>
parents:
25662
diff
changeset
|
765 $TESTENV = 'three' |
812c75fd255c
patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Bram Moolenaar <Bram@vim.org>
parents:
25662
diff
changeset
|
766 $TESTENV |
812c75fd255c
patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Bram Moolenaar <Bram@vim.org>
parents:
25662
diff
changeset
|
767 ->setline(3) |
812c75fd255c
patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Bram Moolenaar <Bram@vim.org>
parents:
25662
diff
changeset
|
768 assert_equal(['one', 'two', 'three'], getline(1, '$')) |
812c75fd255c
patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Bram Moolenaar <Bram@vim.org>
parents:
25662
diff
changeset
|
769 bwipe! |
812c75fd255c
patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Bram Moolenaar <Bram@vim.org>
parents:
25662
diff
changeset
|
770 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
771 v9.CheckDefAndScriptSuccess(lines) |
25670
812c75fd255c
patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Bram Moolenaar <Bram@vim.org>
parents:
25662
diff
changeset
|
772 enddef |
812c75fd255c
patch 8.2.3371: Vim9: :$ENV cannot be followed by ->func() in next line
Bram Moolenaar <Bram@vim.org>
parents:
25662
diff
changeset
|
773 |
22685
80b4e604d1d5
patch 8.2.1891: Vim9: skipping over expression doesn't handle line breaks
Bram Moolenaar <Bram@vim.org>
parents:
22649
diff
changeset
|
774 def Test_skipped_expr_linebreak() |
80b4e604d1d5
patch 8.2.1891: Vim9: skipping over expression doesn't handle line breaks
Bram Moolenaar <Bram@vim.org>
parents:
22649
diff
changeset
|
775 if 0 |
80b4e604d1d5
patch 8.2.1891: Vim9: skipping over expression doesn't handle line breaks
Bram Moolenaar <Bram@vim.org>
parents:
22649
diff
changeset
|
776 var x = [] |
23428
5807e3958e38
patch 8.2.2257: Vim9: using -> for lambda is ambiguous
Bram Moolenaar <Bram@vim.org>
parents:
23422
diff
changeset
|
777 ->map(() => 0) |
22685
80b4e604d1d5
patch 8.2.1891: Vim9: skipping over expression doesn't handle line breaks
Bram Moolenaar <Bram@vim.org>
parents:
22649
diff
changeset
|
778 endif |
80b4e604d1d5
patch 8.2.1891: Vim9: skipping over expression doesn't handle line breaks
Bram Moolenaar <Bram@vim.org>
parents:
22649
diff
changeset
|
779 enddef |
80b4e604d1d5
patch 8.2.1891: Vim9: skipping over expression doesn't handle line breaks
Bram Moolenaar <Bram@vim.org>
parents:
22649
diff
changeset
|
780 |
21212
874a28fac941
patch 8.2.1157: Vim9: dict.name is not recognized as an expression
Bram Moolenaar <Bram@vim.org>
parents:
21196
diff
changeset
|
781 def Test_dict_member() |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
23011
diff
changeset
|
782 var test: dict<list<number>> = {data: [3, 1, 2]} |
21212
874a28fac941
patch 8.2.1157: Vim9: dict.name is not recognized as an expression
Bram Moolenaar <Bram@vim.org>
parents:
21196
diff
changeset
|
783 test.data->sort() |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
23011
diff
changeset
|
784 assert_equal({data: [1, 2, 3]}, test) |
21212
874a28fac941
patch 8.2.1157: Vim9: dict.name is not recognized as an expression
Bram Moolenaar <Bram@vim.org>
parents:
21196
diff
changeset
|
785 test.data |
874a28fac941
patch 8.2.1157: Vim9: dict.name is not recognized as an expression
Bram Moolenaar <Bram@vim.org>
parents:
21196
diff
changeset
|
786 ->reverse() |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
23011
diff
changeset
|
787 assert_equal({data: [3, 2, 1]}, test) |
21212
874a28fac941
patch 8.2.1157: Vim9: dict.name is not recognized as an expression
Bram Moolenaar <Bram@vim.org>
parents:
21196
diff
changeset
|
788 |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
789 var lines =<< trim END |
21212
874a28fac941
patch 8.2.1157: Vim9: dict.name is not recognized as an expression
Bram Moolenaar <Bram@vim.org>
parents:
21196
diff
changeset
|
790 vim9script |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
23011
diff
changeset
|
791 var test: dict<list<number>> = {data: [3, 1, 2]} |
21212
874a28fac941
patch 8.2.1157: Vim9: dict.name is not recognized as an expression
Bram Moolenaar <Bram@vim.org>
parents:
21196
diff
changeset
|
792 test.data->sort() |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
23011
diff
changeset
|
793 assert_equal({data: [1, 2, 3]}, test) |
21212
874a28fac941
patch 8.2.1157: Vim9: dict.name is not recognized as an expression
Bram Moolenaar <Bram@vim.org>
parents:
21196
diff
changeset
|
794 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
795 v9.CheckScriptSuccess(lines) |
21212
874a28fac941
patch 8.2.1157: Vim9: dict.name is not recognized as an expression
Bram Moolenaar <Bram@vim.org>
parents:
21196
diff
changeset
|
796 enddef |
874a28fac941
patch 8.2.1157: Vim9: dict.name is not recognized as an expression
Bram Moolenaar <Bram@vim.org>
parents:
21196
diff
changeset
|
797 |
21156
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
798 def Test_bar_after_command() |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
799 def RedrawAndEcho() |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
800 var x = 'did redraw' |
21156
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
801 redraw | echo x |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
802 enddef |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
803 RedrawAndEcho() |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
804 assert_match('did redraw', g:Screenline(&lines)) |
21156
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
805 |
21158
157fe2d26e16
patch 8.2.1130: Vim9: bar not recognized after function call
Bram Moolenaar <Bram@vim.org>
parents:
21156
diff
changeset
|
806 def CallAndEcho() |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
807 var x = 'did redraw' |
21158
157fe2d26e16
patch 8.2.1130: Vim9: bar not recognized after function call
Bram Moolenaar <Bram@vim.org>
parents:
21156
diff
changeset
|
808 reg_executing() | echo x |
157fe2d26e16
patch 8.2.1130: Vim9: bar not recognized after function call
Bram Moolenaar <Bram@vim.org>
parents:
21156
diff
changeset
|
809 enddef |
157fe2d26e16
patch 8.2.1130: Vim9: bar not recognized after function call
Bram Moolenaar <Bram@vim.org>
parents:
21156
diff
changeset
|
810 CallAndEcho() |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
811 assert_match('did redraw', g:Screenline(&lines)) |
21158
157fe2d26e16
patch 8.2.1130: Vim9: bar not recognized after function call
Bram Moolenaar <Bram@vim.org>
parents:
21156
diff
changeset
|
812 |
21156
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
813 if has('unix') |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
814 # bar in filter write command does not start new command |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
815 def WriteToShell() |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
816 new |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
817 setline(1, 'some text') |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
818 w !cat | cat > Xoutfile |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
819 bwipe! |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
820 enddef |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
821 WriteToShell() |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
822 assert_equal(['some text'], readfile('Xoutfile')) |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
823 delete('Xoutfile') |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
824 |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
825 # bar in filter read command does not start new command |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
826 def ReadFromShell() |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
827 new |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
828 r! echo hello there | cat > Xoutfile |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
829 r !echo again | cat >> Xoutfile |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
830 bwipe! |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
831 enddef |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
832 ReadFromShell() |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
833 assert_equal(['hello there', 'again'], readfile('Xoutfile')) |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
834 delete('Xoutfile') |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
835 endif |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
836 enddef |
eb6c27af07dd
patch 8.2.1129: Vim9: bar not recognized after not compiled command
Bram Moolenaar <Bram@vim.org>
parents:
21130
diff
changeset
|
837 |
21255
4be91a7eafb2
patch 8.2.1178: Vim9: filter function recognized as command modifier
Bram Moolenaar <Bram@vim.org>
parents:
21212
diff
changeset
|
838 def Test_filter_is_not_modifier() |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
23011
diff
changeset
|
839 var tags = [{a: 1, b: 2}, {x: 3, y: 4}] |
23428
5807e3958e38
patch 8.2.2257: Vim9: using -> for lambda is ambiguous
Bram Moolenaar <Bram@vim.org>
parents:
23422
diff
changeset
|
840 filter(tags, ( _, v) => has_key(v, 'x') ? 1 : 0 ) |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
23011
diff
changeset
|
841 assert_equal([{x: 3, y: 4}], tags) |
21255
4be91a7eafb2
patch 8.2.1178: Vim9: filter function recognized as command modifier
Bram Moolenaar <Bram@vim.org>
parents:
21212
diff
changeset
|
842 enddef |
4be91a7eafb2
patch 8.2.1178: Vim9: filter function recognized as command modifier
Bram Moolenaar <Bram@vim.org>
parents:
21212
diff
changeset
|
843 |
22772
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
844 def Test_command_modifier_filter() |
22750
f945413264d7
patch 8.2.1923: Vim9: "filter" command modifier doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
22691
diff
changeset
|
845 var lines =<< trim END |
f945413264d7
patch 8.2.1923: Vim9: "filter" command modifier doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
22691
diff
changeset
|
846 final expected = "\nType Name Content\n c \"c piyo" |
f945413264d7
patch 8.2.1923: Vim9: "filter" command modifier doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
22691
diff
changeset
|
847 @a = 'hoge' |
f945413264d7
patch 8.2.1923: Vim9: "filter" command modifier doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
22691
diff
changeset
|
848 @b = 'fuga' |
f945413264d7
patch 8.2.1923: Vim9: "filter" command modifier doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
22691
diff
changeset
|
849 @c = 'piyo' |
f945413264d7
patch 8.2.1923: Vim9: "filter" command modifier doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
22691
diff
changeset
|
850 |
f945413264d7
patch 8.2.1923: Vim9: "filter" command modifier doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
22691
diff
changeset
|
851 assert_equal(execute('filter /piyo/ registers abc'), expected) |
f945413264d7
patch 8.2.1923: Vim9: "filter" command modifier doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
22691
diff
changeset
|
852 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
853 v9.CheckDefAndScriptSuccess(lines) |
24834
adcd50a18236
patch 8.2.2955: Vim9: using filter in compiled command does not work
Bram Moolenaar <Bram@vim.org>
parents:
24816
diff
changeset
|
854 |
adcd50a18236
patch 8.2.2955: Vim9: using filter in compiled command does not work
Bram Moolenaar <Bram@vim.org>
parents:
24816
diff
changeset
|
855 # also do this compiled |
adcd50a18236
patch 8.2.2955: Vim9: using filter in compiled command does not work
Bram Moolenaar <Bram@vim.org>
parents:
24816
diff
changeset
|
856 lines =<< trim END |
adcd50a18236
patch 8.2.2955: Vim9: using filter in compiled command does not work
Bram Moolenaar <Bram@vim.org>
parents:
24816
diff
changeset
|
857 @a = 'very specific z3d37dh234 string' |
adcd50a18236
patch 8.2.2955: Vim9: using filter in compiled command does not work
Bram Moolenaar <Bram@vim.org>
parents:
24816
diff
changeset
|
858 filter z3d37dh234 registers |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
859 assert_match('very specific z3d37dh234 string', g:Screenline(&lines)) |
24834
adcd50a18236
patch 8.2.2955: Vim9: using filter in compiled command does not work
Bram Moolenaar <Bram@vim.org>
parents:
24816
diff
changeset
|
860 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
861 v9.CheckDefAndScriptSuccess(lines) |
26319
8b594193dcb6
patch 8.2.3690: Vim9: "filter #pat# cmd" does not work
Bram Moolenaar <Bram@vim.org>
parents:
26305
diff
changeset
|
862 |
8b594193dcb6
patch 8.2.3690: Vim9: "filter #pat# cmd" does not work
Bram Moolenaar <Bram@vim.org>
parents:
26305
diff
changeset
|
863 lines =<< trim END |
8b594193dcb6
patch 8.2.3690: Vim9: "filter #pat# cmd" does not work
Bram Moolenaar <Bram@vim.org>
parents:
26305
diff
changeset
|
864 edit foobar |
8b594193dcb6
patch 8.2.3690: Vim9: "filter #pat# cmd" does not work
Bram Moolenaar <Bram@vim.org>
parents:
26305
diff
changeset
|
865 redir => g:filter_out |
8b594193dcb6
patch 8.2.3690: Vim9: "filter #pat# cmd" does not work
Bram Moolenaar <Bram@vim.org>
parents:
26305
diff
changeset
|
866 filter #foobar# ls |
8b594193dcb6
patch 8.2.3690: Vim9: "filter #pat# cmd" does not work
Bram Moolenaar <Bram@vim.org>
parents:
26305
diff
changeset
|
867 redir END |
8b594193dcb6
patch 8.2.3690: Vim9: "filter #pat# cmd" does not work
Bram Moolenaar <Bram@vim.org>
parents:
26305
diff
changeset
|
868 assert_match('"foobar"', g:filter_out) |
8b594193dcb6
patch 8.2.3690: Vim9: "filter #pat# cmd" does not work
Bram Moolenaar <Bram@vim.org>
parents:
26305
diff
changeset
|
869 unlet g:filter_out |
8b594193dcb6
patch 8.2.3690: Vim9: "filter #pat# cmd" does not work
Bram Moolenaar <Bram@vim.org>
parents:
26305
diff
changeset
|
870 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
871 v9.CheckDefAndScriptSuccess(lines) |
22750
f945413264d7
patch 8.2.1923: Vim9: "filter" command modifier doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
22691
diff
changeset
|
872 enddef |
f945413264d7
patch 8.2.1923: Vim9: "filter" command modifier doesn't work
Bram Moolenaar <Bram@vim.org>
parents:
22691
diff
changeset
|
873 |
22772
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
874 def Test_win_command_modifiers() |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
875 assert_equal(1, winnr('$')) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
876 |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
877 set splitright |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
878 vsplit |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
879 assert_equal(2, winnr()) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
880 close |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
881 aboveleft vsplit |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
882 assert_equal(1, winnr()) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
883 close |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
884 set splitright& |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
885 |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
886 vsplit |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
887 assert_equal(1, winnr()) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
888 close |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
889 belowright vsplit |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
890 assert_equal(2, winnr()) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
891 close |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
892 rightbelow vsplit |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
893 assert_equal(2, winnr()) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
894 close |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
895 |
22784
9a6431f4b27a
patch 8.2.1940: Vim9: browse modifier test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22778
diff
changeset
|
896 if has('browse') |
9a6431f4b27a
patch 8.2.1940: Vim9: browse modifier test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22778
diff
changeset
|
897 browse set |
9a6431f4b27a
patch 8.2.1940: Vim9: browse modifier test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22778
diff
changeset
|
898 assert_equal('option-window', expand('%')) |
9a6431f4b27a
patch 8.2.1940: Vim9: browse modifier test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22778
diff
changeset
|
899 close |
9a6431f4b27a
patch 8.2.1940: Vim9: browse modifier test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents:
22778
diff
changeset
|
900 endif |
22772
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
901 |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
902 vsplit |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
903 botright split |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
904 assert_equal(3, winnr()) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
905 assert_equal(&columns, winwidth(0)) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
906 close |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
907 close |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
908 |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
909 vsplit |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
910 topleft split |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
911 assert_equal(1, winnr()) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
912 assert_equal(&columns, winwidth(0)) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
913 close |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
914 close |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
915 |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
916 gettabinfo()->len()->assert_equal(1) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
917 tab split |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
918 gettabinfo()->len()->assert_equal(2) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
919 tabclose |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
920 |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
921 vertical new |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
922 assert_inrange(&columns / 2 - 2, &columns / 2 + 1, winwidth(0)) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
923 close |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
924 enddef |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
925 |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
926 func Test_command_modifier_confirm() |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
927 CheckNotGui |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
928 CheckRunVimInTerminal |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
929 |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
930 " Test for saving all the modified buffers |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
931 let lines =<< trim END |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
932 call setline(1, 'changed') |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
933 def Getout() |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
934 confirm write Xfile |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
935 enddef |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
936 END |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
937 call writefile(lines, 'Xconfirmscript') |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
938 call writefile(['empty'], 'Xfile') |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
939 let buf = RunVimInTerminal('-S Xconfirmscript', {'rows': 8}) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
940 call term_sendkeys(buf, ":call Getout()\n") |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
941 call WaitForAssert({-> assert_match('(Y)es, \[N\]o: ', term_getline(buf, 8))}, 1000) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
942 call term_sendkeys(buf, "y") |
22778
3ec5f653f64d
patch 8.2.1937: Vim9: test for confirm modifier fails in some situations
Bram Moolenaar <Bram@vim.org>
parents:
22772
diff
changeset
|
943 call WaitForAssert({-> assert_match('(Y)es, \[N\]o: ', term_getline(buf, 8))}, 1000) |
3ec5f653f64d
patch 8.2.1937: Vim9: test for confirm modifier fails in some situations
Bram Moolenaar <Bram@vim.org>
parents:
22772
diff
changeset
|
944 call term_sendkeys(buf, "\<CR>") |
3ec5f653f64d
patch 8.2.1937: Vim9: test for confirm modifier fails in some situations
Bram Moolenaar <Bram@vim.org>
parents:
22772
diff
changeset
|
945 call TermWait(buf) |
22772
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
946 call StopVimInTerminal(buf) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
947 |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
948 call assert_equal(['changed'], readfile('Xfile')) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
949 call delete('Xfile') |
22778
3ec5f653f64d
patch 8.2.1937: Vim9: test for confirm modifier fails in some situations
Bram Moolenaar <Bram@vim.org>
parents:
22772
diff
changeset
|
950 call delete('.Xfile.swp') " in case Vim was killed |
22772
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
951 call delete('Xconfirmscript') |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
952 endfunc |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
953 |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
954 def Test_command_modifiers_keep() |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
955 if has('unix') |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
956 def DoTest(addRflag: bool, keepMarks: bool, hasMarks: bool) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
957 new |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
958 setline(1, ['one', 'two', 'three']) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
959 normal 1Gma |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
960 normal 2Gmb |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
961 normal 3Gmc |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
962 if addRflag |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
963 set cpo+=R |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
964 else |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
965 set cpo-=R |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
966 endif |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
967 if keepMarks |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
968 keepmarks :%!cat |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
969 else |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
970 :%!cat |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
971 endif |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
972 if hasMarks |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
973 assert_equal(1, line("'a")) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
974 assert_equal(2, line("'b")) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
975 assert_equal(3, line("'c")) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
976 else |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
977 assert_equal(0, line("'a")) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
978 assert_equal(0, line("'b")) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
979 assert_equal(0, line("'c")) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
980 endif |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
981 quit! |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
982 enddef |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
983 DoTest(false, false, true) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
984 DoTest(true, false, false) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
985 DoTest(false, true, true) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
986 DoTest(true, true, true) |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
987 set cpo&vim |
22812
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
988 |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
989 new |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
990 setline(1, ['one', 'two', 'three', 'four']) |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
991 assert_equal(4, line("$")) |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
992 normal 1Gma |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
993 normal 2Gmb |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
994 normal 3Gmc |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
995 lockmarks :1,2!wc |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
996 # line is deleted, marks don't move |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
997 assert_equal(3, line("$")) |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
998 assert_equal('four', getline(3)) |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
999 assert_equal(1, line("'a")) |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1000 assert_equal(2, line("'b")) |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1001 assert_equal(3, line("'c")) |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1002 quit! |
22772
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
1003 endif |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
1004 |
22812
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1005 edit Xone |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1006 edit Xtwo |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1007 assert_equal('Xone', expand('#')) |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1008 keepalt edit Xthree |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1009 assert_equal('Xone', expand('#')) |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1010 |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1011 normal /a*b* |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1012 assert_equal('a*b*', histget("search")) |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1013 keeppatterns normal /c*d* |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1014 assert_equal('a*b*', histget("search")) |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1015 |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1016 new |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1017 setline(1, range(10)) |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1018 :10 |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1019 normal gg |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1020 assert_equal(10, getpos("''")[1]) |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1021 keepjumps normal 5G |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1022 assert_equal(10, getpos("''")[1]) |
1ef3b04875ff
patch 8.2.1954: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22790
diff
changeset
|
1023 quit! |
22772
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
1024 enddef |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
1025 |
23398
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1026 def Test_bar_line_continuation() |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1027 var lines =<< trim END |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1028 au BufNewFile Xfile g:readFile = 1 |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1029 | g:readExtra = 2 |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1030 g:readFile = 0 |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1031 g:readExtra = 0 |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1032 edit Xfile |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1033 assert_equal(1, g:readFile) |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1034 assert_equal(2, g:readExtra) |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1035 bwipe! |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1036 au! BufNewFile |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1037 |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1038 au BufNewFile Xfile g:readFile = 1 |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1039 | g:readExtra = 2 |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1040 | g:readMore = 3 |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1041 g:readFile = 0 |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1042 g:readExtra = 0 |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1043 g:readMore = 0 |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1044 edit Xfile |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1045 assert_equal(1, g:readFile) |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1046 assert_equal(2, g:readExtra) |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1047 assert_equal(3, g:readMore) |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1048 bwipe! |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1049 au! BufNewFile |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1050 unlet g:readFile |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1051 unlet g:readExtra |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1052 unlet g:readMore |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1053 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1054 v9.CheckDefAndScriptSuccess(lines) |
23398
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1055 enddef |
40f824f5c7c7
patch 8.2.2242: Vim9: bar line continuation does not work at script level
Bram Moolenaar <Bram@vim.org>
parents:
23392
diff
changeset
|
1056 |
22772
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
1057 def Test_command_modifier_other() |
22814
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1058 new Xsomefile |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1059 setline(1, 'changed') |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1060 var buf = bufnr() |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1061 hide edit Xotherfile |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1062 var info = getbufinfo(buf) |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1063 assert_equal(1, info[0].hidden) |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1064 assert_equal(1, info[0].changed) |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1065 edit Xsomefile |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1066 bwipe! |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1067 |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1068 au BufNewFile Xfile g:readFile = 1 |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1069 g:readFile = 0 |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1070 edit Xfile |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1071 assert_equal(1, g:readFile) |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1072 bwipe! |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1073 g:readFile = 0 |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1074 noautocmd edit Xfile |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1075 assert_equal(0, g:readFile) |
23392
517fca70e084
patch 8.2.2239: Vim9: concatenating lines with backslash is inconvenient
Bram Moolenaar <Bram@vim.org>
parents:
23374
diff
changeset
|
1076 au! BufNewFile |
517fca70e084
patch 8.2.2239: Vim9: concatenating lines with backslash is inconvenient
Bram Moolenaar <Bram@vim.org>
parents:
23374
diff
changeset
|
1077 unlet g:readFile |
22814
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1078 |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1079 noswapfile edit XnoSwap |
23422
bb0c53f4ef8b
patch 8.2.2254: Vim9: bool option type is number
Bram Moolenaar <Bram@vim.org>
parents:
23398
diff
changeset
|
1080 assert_equal(false, &l:swapfile) |
22814
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1081 bwipe! |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1082 |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1083 var caught = false |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1084 try |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1085 sandbox !ls |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1086 catch /E48:/ |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1087 caught = true |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1088 endtry |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1089 assert_true(caught) |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1090 |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1091 :8verbose g:verbose_now = &verbose |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1092 assert_equal(8, g:verbose_now) |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1093 unlet g:verbose_now |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1094 enddef |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1095 |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1096 def s:EchoHere() |
22814
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1097 echomsg 'here' |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1098 enddef |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1099 def s:EchoThere() |
22814
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1100 unsilent echomsg 'there' |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1101 enddef |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1102 |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1103 def Test_modifier_silent_unsilent() |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1104 echomsg 'last one' |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1105 silent echomsg "text" |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1106 assert_equal("\nlast one", execute(':1messages')) |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1107 |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1108 silent! echoerr "error" |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1109 |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1110 echomsg 'last one' |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1111 silent EchoHere() |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1112 assert_equal("\nlast one", execute(':1messages')) |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1113 |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1114 silent EchoThere() |
bb1b21a2aae3
patch 8.2.1955: Vim9: not all command modifiers are tested
Bram Moolenaar <Bram@vim.org>
parents:
22812
diff
changeset
|
1115 assert_equal("\nthere", execute(':1messages')) |
23348
456d625bb8c1
patch 8.2.2217: Vim9: command modifiers not restored in catch block
Bram Moolenaar <Bram@vim.org>
parents:
23346
diff
changeset
|
1116 |
456d625bb8c1
patch 8.2.2217: Vim9: command modifiers not restored in catch block
Bram Moolenaar <Bram@vim.org>
parents:
23346
diff
changeset
|
1117 try |
456d625bb8c1
patch 8.2.2217: Vim9: command modifiers not restored in catch block
Bram Moolenaar <Bram@vim.org>
parents:
23346
diff
changeset
|
1118 silent eval [][0] |
456d625bb8c1
patch 8.2.2217: Vim9: command modifiers not restored in catch block
Bram Moolenaar <Bram@vim.org>
parents:
23346
diff
changeset
|
1119 catch |
456d625bb8c1
patch 8.2.2217: Vim9: command modifiers not restored in catch block
Bram Moolenaar <Bram@vim.org>
parents:
23346
diff
changeset
|
1120 echomsg "caught" |
456d625bb8c1
patch 8.2.2217: Vim9: command modifiers not restored in catch block
Bram Moolenaar <Bram@vim.org>
parents:
23346
diff
changeset
|
1121 endtry |
456d625bb8c1
patch 8.2.2217: Vim9: command modifiers not restored in catch block
Bram Moolenaar <Bram@vim.org>
parents:
23346
diff
changeset
|
1122 assert_equal("\ncaught", execute(':1messages')) |
25575
9f691e8a74e3
patch 8.2.3324: Vim9: Cannot use :silent with :endwhile
Bram Moolenaar <Bram@vim.org>
parents:
25485
diff
changeset
|
1123 |
9f691e8a74e3
patch 8.2.3324: Vim9: Cannot use :silent with :endwhile
Bram Moolenaar <Bram@vim.org>
parents:
25485
diff
changeset
|
1124 var lines =<< trim END |
9f691e8a74e3
patch 8.2.3324: Vim9: Cannot use :silent with :endwhile
Bram Moolenaar <Bram@vim.org>
parents:
25485
diff
changeset
|
1125 vim9script |
9f691e8a74e3
patch 8.2.3324: Vim9: Cannot use :silent with :endwhile
Bram Moolenaar <Bram@vim.org>
parents:
25485
diff
changeset
|
1126 set history=11 |
9f691e8a74e3
patch 8.2.3324: Vim9: Cannot use :silent with :endwhile
Bram Moolenaar <Bram@vim.org>
parents:
25485
diff
changeset
|
1127 silent! while 0 |
9f691e8a74e3
patch 8.2.3324: Vim9: Cannot use :silent with :endwhile
Bram Moolenaar <Bram@vim.org>
parents:
25485
diff
changeset
|
1128 set history=22 |
9f691e8a74e3
patch 8.2.3324: Vim9: Cannot use :silent with :endwhile
Bram Moolenaar <Bram@vim.org>
parents:
25485
diff
changeset
|
1129 silent! endwhile |
9f691e8a74e3
patch 8.2.3324: Vim9: Cannot use :silent with :endwhile
Bram Moolenaar <Bram@vim.org>
parents:
25485
diff
changeset
|
1130 assert_equal(11, &history) |
9f691e8a74e3
patch 8.2.3324: Vim9: Cannot use :silent with :endwhile
Bram Moolenaar <Bram@vim.org>
parents:
25485
diff
changeset
|
1131 set history& |
9f691e8a74e3
patch 8.2.3324: Vim9: Cannot use :silent with :endwhile
Bram Moolenaar <Bram@vim.org>
parents:
25485
diff
changeset
|
1132 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1133 v9.CheckScriptSuccess(lines) |
22772
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
1134 enddef |
82a7aff951d2
patch 8.2.1934: Vim9: command modifiers in :def function not tested
Bram Moolenaar <Bram@vim.org>
parents:
22750
diff
changeset
|
1135 |
22790
44317eb799d7
patch 8.2.1943: Vim9: wrong error message when colon is missing
Bram Moolenaar <Bram@vim.org>
parents:
22784
diff
changeset
|
1136 def Test_range_after_command_modifier() |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1137 v9.CheckScriptFailure(['vim9script', 'silent keepjump 1d _'], 'E1050: Colon required before a range: 1d _', 2) |
22790
44317eb799d7
patch 8.2.1943: Vim9: wrong error message when colon is missing
Bram Moolenaar <Bram@vim.org>
parents:
22784
diff
changeset
|
1138 new |
44317eb799d7
patch 8.2.1943: Vim9: wrong error message when colon is missing
Bram Moolenaar <Bram@vim.org>
parents:
22784
diff
changeset
|
1139 setline(1, 'xxx') |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1140 v9.CheckScriptSuccess(['vim9script', 'silent keepjump :1d _']) |
22790
44317eb799d7
patch 8.2.1943: Vim9: wrong error message when colon is missing
Bram Moolenaar <Bram@vim.org>
parents:
22784
diff
changeset
|
1141 assert_equal('', getline(1)) |
44317eb799d7
patch 8.2.1943: Vim9: wrong error message when colon is missing
Bram Moolenaar <Bram@vim.org>
parents:
22784
diff
changeset
|
1142 bwipe! |
26404
1bbb884c8561
patch 8.2.3733: Vim9: using "legacy" before range does not work
Bram Moolenaar <Bram@vim.org>
parents:
26360
diff
changeset
|
1143 |
1bbb884c8561
patch 8.2.3733: Vim9: using "legacy" before range does not work
Bram Moolenaar <Bram@vim.org>
parents:
26360
diff
changeset
|
1144 var lines =<< trim END |
1bbb884c8561
patch 8.2.3733: Vim9: using "legacy" before range does not work
Bram Moolenaar <Bram@vim.org>
parents:
26360
diff
changeset
|
1145 legacy /pat/ |
1bbb884c8561
patch 8.2.3733: Vim9: using "legacy" before range does not work
Bram Moolenaar <Bram@vim.org>
parents:
26360
diff
changeset
|
1146 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1147 v9.CheckDefExecAndScriptFailure(lines, 'E486: Pattern not found: pat') |
22790
44317eb799d7
patch 8.2.1943: Vim9: wrong error message when colon is missing
Bram Moolenaar <Bram@vim.org>
parents:
22784
diff
changeset
|
1148 enddef |
44317eb799d7
patch 8.2.1943: Vim9: wrong error message when colon is missing
Bram Moolenaar <Bram@vim.org>
parents:
22784
diff
changeset
|
1149 |
23541
a2a38bc68dd9
patch 8.2.2313: Vim9: using uninitialized field when parsing range
Bram Moolenaar <Bram@vim.org>
parents:
23521
diff
changeset
|
1150 def Test_silent_pattern() |
a2a38bc68dd9
patch 8.2.2313: Vim9: using uninitialized field when parsing range
Bram Moolenaar <Bram@vim.org>
parents:
23521
diff
changeset
|
1151 new |
a2a38bc68dd9
patch 8.2.2313: Vim9: using uninitialized field when parsing range
Bram Moolenaar <Bram@vim.org>
parents:
23521
diff
changeset
|
1152 silent! :/pat/put _ |
a2a38bc68dd9
patch 8.2.2313: Vim9: using uninitialized field when parsing range
Bram Moolenaar <Bram@vim.org>
parents:
23521
diff
changeset
|
1153 bwipe! |
a2a38bc68dd9
patch 8.2.2313: Vim9: using uninitialized field when parsing range
Bram Moolenaar <Bram@vim.org>
parents:
23521
diff
changeset
|
1154 enddef |
a2a38bc68dd9
patch 8.2.2313: Vim9: using uninitialized field when parsing range
Bram Moolenaar <Bram@vim.org>
parents:
23521
diff
changeset
|
1155 |
24222
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1156 def Test_useless_command_modifier() |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1157 g:maybe = true |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1158 var lines =<< trim END |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1159 if g:maybe |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1160 silent endif |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1161 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1162 v9.CheckDefAndScriptFailure(lines, 'E1176:', 2) |
24222
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1163 |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1164 lines =<< trim END |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1165 for i in [0] |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1166 silent endfor |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1167 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1168 v9.CheckDefFailure(lines, 'E1176:', 2) |
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1169 v9.CheckScriptSuccess(['vim9script'] + lines) |
24222
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1170 |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1171 lines =<< trim END |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1172 while g:maybe |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1173 silent endwhile |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1174 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1175 v9.CheckDefFailure(lines, 'E1176:', 2) |
25575
9f691e8a74e3
patch 8.2.3324: Vim9: Cannot use :silent with :endwhile
Bram Moolenaar <Bram@vim.org>
parents:
25485
diff
changeset
|
1176 g:maybe = false |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1177 v9.CheckScriptSuccess(['vim9script'] + lines) |
24222
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1178 |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1179 lines =<< trim END |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1180 silent try |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1181 finally |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1182 endtry |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1183 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1184 v9.CheckDefAndScriptFailure(lines, 'E1176:', 1) |
24222
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1185 |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1186 lines =<< trim END |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1187 try |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1188 silent catch |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1189 endtry |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1190 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1191 v9.CheckDefAndScriptFailure(lines, 'E1176:', 2) |
24222
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1192 |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1193 lines =<< trim END |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1194 try |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1195 silent finally |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1196 endtry |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1197 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1198 v9.CheckDefAndScriptFailure(lines, 'E1176:', 2) |
24222
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1199 |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1200 lines =<< trim END |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1201 try |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1202 finally |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1203 silent endtry |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1204 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1205 v9.CheckDefAndScriptFailure(lines, 'E1176:', 3) |
27716
4097434c7c67
patch 8.2.4384: Vim9: error message not tested, some code not tested
Bram Moolenaar <Bram@vim.org>
parents:
27678
diff
changeset
|
1206 |
4097434c7c67
patch 8.2.4384: Vim9: error message not tested, some code not tested
Bram Moolenaar <Bram@vim.org>
parents:
27678
diff
changeset
|
1207 lines =<< trim END |
4097434c7c67
patch 8.2.4384: Vim9: error message not tested, some code not tested
Bram Moolenaar <Bram@vim.org>
parents:
27678
diff
changeset
|
1208 leftabove |
4097434c7c67
patch 8.2.4384: Vim9: error message not tested, some code not tested
Bram Moolenaar <Bram@vim.org>
parents:
27678
diff
changeset
|
1209 END |
4097434c7c67
patch 8.2.4384: Vim9: error message not tested, some code not tested
Bram Moolenaar <Bram@vim.org>
parents:
27678
diff
changeset
|
1210 v9.CheckDefAndScriptFailure(lines, 'E1082:', 1) |
4097434c7c67
patch 8.2.4384: Vim9: error message not tested, some code not tested
Bram Moolenaar <Bram@vim.org>
parents:
27678
diff
changeset
|
1211 |
4097434c7c67
patch 8.2.4384: Vim9: error message not tested, some code not tested
Bram Moolenaar <Bram@vim.org>
parents:
27678
diff
changeset
|
1212 lines =<< trim END |
4097434c7c67
patch 8.2.4384: Vim9: error message not tested, some code not tested
Bram Moolenaar <Bram@vim.org>
parents:
27678
diff
changeset
|
1213 leftabove # comment |
4097434c7c67
patch 8.2.4384: Vim9: error message not tested, some code not tested
Bram Moolenaar <Bram@vim.org>
parents:
27678
diff
changeset
|
1214 END |
4097434c7c67
patch 8.2.4384: Vim9: error message not tested, some code not tested
Bram Moolenaar <Bram@vim.org>
parents:
27678
diff
changeset
|
1215 v9.CheckDefAndScriptFailure(lines, 'E1082:', 1) |
24222
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1216 enddef |
a2e6029d354e
patch 8.2.2652: Vim9: can use command modifier without an effect
Bram Moolenaar <Bram@vim.org>
parents:
24216
diff
changeset
|
1217 |
21196
f45ce1ce284c
patch 8.2.1149: Vim9: :eval command not handled properly
Bram Moolenaar <Bram@vim.org>
parents:
21158
diff
changeset
|
1218 def Test_eval_command() |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
1219 var from = 3 |
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
1220 var to = 5 |
21196
f45ce1ce284c
patch 8.2.1149: Vim9: :eval command not handled properly
Bram Moolenaar <Bram@vim.org>
parents:
21158
diff
changeset
|
1221 g:val = 111 |
f45ce1ce284c
patch 8.2.1149: Vim9: :eval command not handled properly
Bram Moolenaar <Bram@vim.org>
parents:
21158
diff
changeset
|
1222 def Increment(nrs: list<number>) |
f45ce1ce284c
patch 8.2.1149: Vim9: :eval command not handled properly
Bram Moolenaar <Bram@vim.org>
parents:
21158
diff
changeset
|
1223 for nr in nrs |
f45ce1ce284c
patch 8.2.1149: Vim9: :eval command not handled properly
Bram Moolenaar <Bram@vim.org>
parents:
21158
diff
changeset
|
1224 g:val += nr |
f45ce1ce284c
patch 8.2.1149: Vim9: :eval command not handled properly
Bram Moolenaar <Bram@vim.org>
parents:
21158
diff
changeset
|
1225 endfor |
f45ce1ce284c
patch 8.2.1149: Vim9: :eval command not handled properly
Bram Moolenaar <Bram@vim.org>
parents:
21158
diff
changeset
|
1226 enddef |
f45ce1ce284c
patch 8.2.1149: Vim9: :eval command not handled properly
Bram Moolenaar <Bram@vim.org>
parents:
21158
diff
changeset
|
1227 eval range(from, to) |
f45ce1ce284c
patch 8.2.1149: Vim9: :eval command not handled properly
Bram Moolenaar <Bram@vim.org>
parents:
21158
diff
changeset
|
1228 ->Increment() |
f45ce1ce284c
patch 8.2.1149: Vim9: :eval command not handled properly
Bram Moolenaar <Bram@vim.org>
parents:
21158
diff
changeset
|
1229 assert_equal(111 + 3 + 4 + 5, g:val) |
f45ce1ce284c
patch 8.2.1149: Vim9: :eval command not handled properly
Bram Moolenaar <Bram@vim.org>
parents:
21158
diff
changeset
|
1230 unlet g:val |
23096
b6aadb0b3a56
patch 8.2.2094: when an expression fails getting next command may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
1231 |
b6aadb0b3a56
patch 8.2.2094: when an expression fails getting next command may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
1232 var lines =<< trim END |
b6aadb0b3a56
patch 8.2.2094: when an expression fails getting next command may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
1233 vim9script |
b6aadb0b3a56
patch 8.2.2094: when an expression fails getting next command may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
1234 g:caught = 'no' |
b6aadb0b3a56
patch 8.2.2094: when an expression fails getting next command may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
1235 try |
b6aadb0b3a56
patch 8.2.2094: when an expression fails getting next command may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
1236 eval 123 || 0 |
b6aadb0b3a56
patch 8.2.2094: when an expression fails getting next command may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
1237 catch |
b6aadb0b3a56
patch 8.2.2094: when an expression fails getting next command may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
1238 g:caught = 'yes' |
b6aadb0b3a56
patch 8.2.2094: when an expression fails getting next command may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
1239 endtry |
b6aadb0b3a56
patch 8.2.2094: when an expression fails getting next command may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
1240 assert_equal('yes', g:caught) |
b6aadb0b3a56
patch 8.2.2094: when an expression fails getting next command may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
1241 unlet g:caught |
b6aadb0b3a56
patch 8.2.2094: when an expression fails getting next command may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
1242 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1243 v9.CheckScriptSuccess(lines) |
21196
f45ce1ce284c
patch 8.2.1149: Vim9: :eval command not handled properly
Bram Moolenaar <Bram@vim.org>
parents:
21158
diff
changeset
|
1244 enddef |
f45ce1ce284c
patch 8.2.1149: Vim9: :eval command not handled properly
Bram Moolenaar <Bram@vim.org>
parents:
21158
diff
changeset
|
1245 |
21893
f19ac9b8b011
patch 8.2.1496: Vim9: cannot use " #" in a mapping
Bram Moolenaar <Bram@vim.org>
parents:
21255
diff
changeset
|
1246 def Test_map_command() |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
1247 var lines =<< trim END |
21893
f19ac9b8b011
patch 8.2.1496: Vim9: cannot use " #" in a mapping
Bram Moolenaar <Bram@vim.org>
parents:
21255
diff
changeset
|
1248 nnoremap <F3> :echo 'hit F3 #'<CR> |
f19ac9b8b011
patch 8.2.1496: Vim9: cannot use " #" in a mapping
Bram Moolenaar <Bram@vim.org>
parents:
21255
diff
changeset
|
1249 assert_equal(":echo 'hit F3 #'<CR>", maparg("<F3>", "n")) |
f19ac9b8b011
patch 8.2.1496: Vim9: cannot use " #" in a mapping
Bram Moolenaar <Bram@vim.org>
parents:
21255
diff
changeset
|
1250 END |
28179
49631bf057d3
patch 8.2.4615: mapping with escaped bar does not work in :def function
Bram Moolenaar <Bram@vim.org>
parents:
28154
diff
changeset
|
1251 v9.CheckDefAndScriptSuccess(lines) |
49631bf057d3
patch 8.2.4615: mapping with escaped bar does not work in :def function
Bram Moolenaar <Bram@vim.org>
parents:
28154
diff
changeset
|
1252 |
49631bf057d3
patch 8.2.4615: mapping with escaped bar does not work in :def function
Bram Moolenaar <Bram@vim.org>
parents:
28154
diff
changeset
|
1253 # backslash before bar is not removed |
49631bf057d3
patch 8.2.4615: mapping with escaped bar does not work in :def function
Bram Moolenaar <Bram@vim.org>
parents:
28154
diff
changeset
|
1254 lines =<< trim END |
49631bf057d3
patch 8.2.4615: mapping with escaped bar does not work in :def function
Bram Moolenaar <Bram@vim.org>
parents:
28154
diff
changeset
|
1255 vim9script |
49631bf057d3
patch 8.2.4615: mapping with escaped bar does not work in :def function
Bram Moolenaar <Bram@vim.org>
parents:
28154
diff
changeset
|
1256 |
49631bf057d3
patch 8.2.4615: mapping with escaped bar does not work in :def function
Bram Moolenaar <Bram@vim.org>
parents:
28154
diff
changeset
|
1257 def Init() |
49631bf057d3
patch 8.2.4615: mapping with escaped bar does not work in :def function
Bram Moolenaar <Bram@vim.org>
parents:
28154
diff
changeset
|
1258 noremap <buffer> <F5> <ScriptCmd>MyFunc('a') \| MyFunc('b')<CR> |
49631bf057d3
patch 8.2.4615: mapping with escaped bar does not work in :def function
Bram Moolenaar <Bram@vim.org>
parents:
28154
diff
changeset
|
1259 enddef |
49631bf057d3
patch 8.2.4615: mapping with escaped bar does not work in :def function
Bram Moolenaar <Bram@vim.org>
parents:
28154
diff
changeset
|
1260 Init() |
49631bf057d3
patch 8.2.4615: mapping with escaped bar does not work in :def function
Bram Moolenaar <Bram@vim.org>
parents:
28154
diff
changeset
|
1261 unmap <buffer> <F5> |
49631bf057d3
patch 8.2.4615: mapping with escaped bar does not work in :def function
Bram Moolenaar <Bram@vim.org>
parents:
28154
diff
changeset
|
1262 END |
49631bf057d3
patch 8.2.4615: mapping with escaped bar does not work in :def function
Bram Moolenaar <Bram@vim.org>
parents:
28154
diff
changeset
|
1263 v9.CheckScriptSuccess(lines) |
21893
f19ac9b8b011
patch 8.2.1496: Vim9: cannot use " #" in a mapping
Bram Moolenaar <Bram@vim.org>
parents:
21255
diff
changeset
|
1264 enddef |
f19ac9b8b011
patch 8.2.1496: Vim9: cannot use " #" in a mapping
Bram Moolenaar <Bram@vim.org>
parents:
21255
diff
changeset
|
1265 |
21941
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1266 def Test_normal_command() |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1267 new |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1268 setline(1, 'doesnotexist') |
22425
eabc059a6ac4
patch 8.2.1761: Vim9: Some tests are still using :let
Bram Moolenaar <Bram@vim.org>
parents:
22351
diff
changeset
|
1269 var caught = 0 |
21941
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1270 try |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1271 exe "norm! \<C-]>" |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1272 catch /E433/ |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1273 caught = 2 |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1274 endtry |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1275 assert_equal(2, caught) |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1276 |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1277 try |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1278 exe "norm! 3\<C-]>" |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1279 catch /E433/ |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1280 caught = 3 |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1281 endtry |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1282 assert_equal(3, caught) |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1283 bwipe! |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1284 enddef |
f65e76638eb5
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
21893
diff
changeset
|
1285 |
22176
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1286 def Test_put_command() |
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1287 new |
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1288 @p = 'ppp' |
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1289 put p |
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1290 assert_equal('ppp', getline(2)) |
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1291 |
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1292 put ='below' |
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1293 assert_equal('below', getline(3)) |
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1294 put! ='above' |
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1295 assert_equal('above', getline(3)) |
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1296 assert_equal('below', getline(4)) |
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1297 |
23628
b26bbc03126a
patch 8.2.2356: Vim9: ":put =expr" does not handle a list properly
Bram Moolenaar <Bram@vim.org>
parents:
23580
diff
changeset
|
1298 :2put =['a', 'b', 'c'] |
b26bbc03126a
patch 8.2.2356: Vim9: ":put =expr" does not handle a list properly
Bram Moolenaar <Bram@vim.org>
parents:
23580
diff
changeset
|
1299 assert_equal(['ppp', 'a', 'b', 'c', 'above'], getline(2, 6)) |
b26bbc03126a
patch 8.2.2356: Vim9: ":put =expr" does not handle a list properly
Bram Moolenaar <Bram@vim.org>
parents:
23580
diff
changeset
|
1300 |
28055
5bf3ed75e26c
patch 8.2.4552: in a :def function "put = expr" does not work
Bram Moolenaar <Bram@vim.org>
parents:
27964
diff
changeset
|
1301 :0put = 'first' |
27585
a31dd0a3cb39
patch 8.2.4319: :put does not work properly in compiled function
Bram Moolenaar <Bram@vim.org>
parents:
27539
diff
changeset
|
1302 assert_equal('first', getline(1)) |
a31dd0a3cb39
patch 8.2.4319: :put does not work properly in compiled function
Bram Moolenaar <Bram@vim.org>
parents:
27539
diff
changeset
|
1303 :1put! ='first again' |
a31dd0a3cb39
patch 8.2.4319: :put does not work properly in compiled function
Bram Moolenaar <Bram@vim.org>
parents:
27539
diff
changeset
|
1304 assert_equal('first again', getline(1)) |
a31dd0a3cb39
patch 8.2.4319: :put does not work properly in compiled function
Bram Moolenaar <Bram@vim.org>
parents:
27539
diff
changeset
|
1305 |
23156
6aa8ddf7a3fa
patch 8.2.2124: Vim9: a range cannot be computed at runtime
Bram Moolenaar <Bram@vim.org>
parents:
23096
diff
changeset
|
1306 # compute range at runtime |
27585
a31dd0a3cb39
patch 8.2.4319: :put does not work properly in compiled function
Bram Moolenaar <Bram@vim.org>
parents:
27539
diff
changeset
|
1307 :%del |
23156
6aa8ddf7a3fa
patch 8.2.2124: Vim9: a range cannot be computed at runtime
Bram Moolenaar <Bram@vim.org>
parents:
23096
diff
changeset
|
1308 setline(1, range(1, 8)) |
6aa8ddf7a3fa
patch 8.2.2124: Vim9: a range cannot be computed at runtime
Bram Moolenaar <Bram@vim.org>
parents:
23096
diff
changeset
|
1309 @a = 'aaa' |
6aa8ddf7a3fa
patch 8.2.2124: Vim9: a range cannot be computed at runtime
Bram Moolenaar <Bram@vim.org>
parents:
23096
diff
changeset
|
1310 :$-2put a |
6aa8ddf7a3fa
patch 8.2.2124: Vim9: a range cannot be computed at runtime
Bram Moolenaar <Bram@vim.org>
parents:
23096
diff
changeset
|
1311 assert_equal('aaa', getline(7)) |
6aa8ddf7a3fa
patch 8.2.2124: Vim9: a range cannot be computed at runtime
Bram Moolenaar <Bram@vim.org>
parents:
23096
diff
changeset
|
1312 |
6aa8ddf7a3fa
patch 8.2.2124: Vim9: a range cannot be computed at runtime
Bram Moolenaar <Bram@vim.org>
parents:
23096
diff
changeset
|
1313 setline(1, range(1, 8)) |
6aa8ddf7a3fa
patch 8.2.2124: Vim9: a range cannot be computed at runtime
Bram Moolenaar <Bram@vim.org>
parents:
23096
diff
changeset
|
1314 :2 |
6aa8ddf7a3fa
patch 8.2.2124: Vim9: a range cannot be computed at runtime
Bram Moolenaar <Bram@vim.org>
parents:
23096
diff
changeset
|
1315 :+2put! a |
6aa8ddf7a3fa
patch 8.2.2124: Vim9: a range cannot be computed at runtime
Bram Moolenaar <Bram@vim.org>
parents:
23096
diff
changeset
|
1316 assert_equal('aaa', getline(4)) |
6aa8ddf7a3fa
patch 8.2.2124: Vim9: a range cannot be computed at runtime
Bram Moolenaar <Bram@vim.org>
parents:
23096
diff
changeset
|
1317 |
23671
9ee9c4246a7f
patch 8.2.2377: Vim9: crash when using a range after another expression
Bram Moolenaar <Bram@vim.org>
parents:
23628
diff
changeset
|
1318 []->mapnew(() => 0) |
9ee9c4246a7f
patch 8.2.2377: Vim9: crash when using a range after another expression
Bram Moolenaar <Bram@vim.org>
parents:
23628
diff
changeset
|
1319 :$put ='end' |
9ee9c4246a7f
patch 8.2.2377: Vim9: crash when using a range after another expression
Bram Moolenaar <Bram@vim.org>
parents:
23628
diff
changeset
|
1320 assert_equal('end', getline('$')) |
9ee9c4246a7f
patch 8.2.2377: Vim9: crash when using a range after another expression
Bram Moolenaar <Bram@vim.org>
parents:
23628
diff
changeset
|
1321 |
22176
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1322 bwipe! |
23197
4ba101403fa2
patch 8.2.2144: Vim9: some corner cases not tested
Bram Moolenaar <Bram@vim.org>
parents:
23156
diff
changeset
|
1323 |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1324 v9.CheckDefFailure(['put =xxx'], 'E1001:') |
23197
4ba101403fa2
patch 8.2.2144: Vim9: some corner cases not tested
Bram Moolenaar <Bram@vim.org>
parents:
23156
diff
changeset
|
1325 enddef |
4ba101403fa2
patch 8.2.2144: Vim9: some corner cases not tested
Bram Moolenaar <Bram@vim.org>
parents:
23156
diff
changeset
|
1326 |
4ba101403fa2
patch 8.2.2144: Vim9: some corner cases not tested
Bram Moolenaar <Bram@vim.org>
parents:
23156
diff
changeset
|
1327 def Test_put_with_linebreak() |
4ba101403fa2
patch 8.2.2144: Vim9: some corner cases not tested
Bram Moolenaar <Bram@vim.org>
parents:
23156
diff
changeset
|
1328 new |
4ba101403fa2
patch 8.2.2144: Vim9: some corner cases not tested
Bram Moolenaar <Bram@vim.org>
parents:
23156
diff
changeset
|
1329 var lines =<< trim END |
4ba101403fa2
patch 8.2.2144: Vim9: some corner cases not tested
Bram Moolenaar <Bram@vim.org>
parents:
23156
diff
changeset
|
1330 vim9script |
4ba101403fa2
patch 8.2.2144: Vim9: some corner cases not tested
Bram Moolenaar <Bram@vim.org>
parents:
23156
diff
changeset
|
1331 pu =split('abc', '\zs') |
4ba101403fa2
patch 8.2.2144: Vim9: some corner cases not tested
Bram Moolenaar <Bram@vim.org>
parents:
23156
diff
changeset
|
1332 ->join() |
4ba101403fa2
patch 8.2.2144: Vim9: some corner cases not tested
Bram Moolenaar <Bram@vim.org>
parents:
23156
diff
changeset
|
1333 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1334 v9.CheckScriptSuccess(lines) |
23197
4ba101403fa2
patch 8.2.2144: Vim9: some corner cases not tested
Bram Moolenaar <Bram@vim.org>
parents:
23156
diff
changeset
|
1335 getline(2)->assert_equal('a b c') |
4ba101403fa2
patch 8.2.2144: Vim9: some corner cases not tested
Bram Moolenaar <Bram@vim.org>
parents:
23156
diff
changeset
|
1336 bwipe! |
22176
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1337 enddef |
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1338 |
22260
d7c1e3efa88e
patch 8.2.1679: Vim9: ":*" is not recognized as a range
Bram Moolenaar <Bram@vim.org>
parents:
22176
diff
changeset
|
1339 def Test_command_star_range() |
d7c1e3efa88e
patch 8.2.1679: Vim9: ":*" is not recognized as a range
Bram Moolenaar <Bram@vim.org>
parents:
22176
diff
changeset
|
1340 new |
d7c1e3efa88e
patch 8.2.1679: Vim9: ":*" is not recognized as a range
Bram Moolenaar <Bram@vim.org>
parents:
22176
diff
changeset
|
1341 setline(1, ['xxx foo xxx', 'xxx bar xxx', 'xxx foo xx bar']) |
d7c1e3efa88e
patch 8.2.1679: Vim9: ":*" is not recognized as a range
Bram Moolenaar <Bram@vim.org>
parents:
22176
diff
changeset
|
1342 setpos("'<", [0, 1, 0, 0]) |
d7c1e3efa88e
patch 8.2.1679: Vim9: ":*" is not recognized as a range
Bram Moolenaar <Bram@vim.org>
parents:
22176
diff
changeset
|
1343 setpos("'>", [0, 3, 0, 0]) |
d7c1e3efa88e
patch 8.2.1679: Vim9: ":*" is not recognized as a range
Bram Moolenaar <Bram@vim.org>
parents:
22176
diff
changeset
|
1344 :*s/\(foo\|bar\)/baz/g |
d7c1e3efa88e
patch 8.2.1679: Vim9: ":*" is not recognized as a range
Bram Moolenaar <Bram@vim.org>
parents:
22176
diff
changeset
|
1345 getline(1, 3)->assert_equal(['xxx baz xxx', 'xxx baz xxx', 'xxx baz xx baz']) |
d7c1e3efa88e
patch 8.2.1679: Vim9: ":*" is not recognized as a range
Bram Moolenaar <Bram@vim.org>
parents:
22176
diff
changeset
|
1346 |
d7c1e3efa88e
patch 8.2.1679: Vim9: ":*" is not recognized as a range
Bram Moolenaar <Bram@vim.org>
parents:
22176
diff
changeset
|
1347 bwipe! |
d7c1e3efa88e
patch 8.2.1679: Vim9: ":*" is not recognized as a range
Bram Moolenaar <Bram@vim.org>
parents:
22176
diff
changeset
|
1348 enddef |
d7c1e3efa88e
patch 8.2.1679: Vim9: ":*" is not recognized as a range
Bram Moolenaar <Bram@vim.org>
parents:
22176
diff
changeset
|
1349 |
22649
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1350 def Test_f_args() |
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1351 var lines =<< trim END |
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1352 vim9script |
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1353 |
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1354 func SaveCmdArgs(...) |
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1355 let g:args = a:000 |
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1356 endfunc |
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1357 |
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1358 command -nargs=* TestFArgs call SaveCmdArgs(<f-args>) |
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1359 |
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1360 TestFArgs |
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1361 assert_equal([], g:args) |
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1362 |
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1363 TestFArgs one two three |
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1364 assert_equal(['one', 'two', 'three'], g:args) |
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1365 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1366 v9.CheckScriptSuccess(lines) |
22649
6e965b3587a4
patch 8.2.1873: Vim9: missing white space when using <f-args>
Bram Moolenaar <Bram@vim.org>
parents:
22500
diff
changeset
|
1367 enddef |
22176
6941d3205be9
patch 8.2.1637: Vim9: :put ={expr} does not work inside :def function
Bram Moolenaar <Bram@vim.org>
parents:
21941
diff
changeset
|
1368 |
23513
872239543313
patch 8.2.2299: Vim9: invalid memory access making error message flaky
Bram Moolenaar <Bram@vim.org>
parents:
23477
diff
changeset
|
1369 def Test_user_command_comment() |
872239543313
patch 8.2.2299: Vim9: invalid memory access making error message flaky
Bram Moolenaar <Bram@vim.org>
parents:
23477
diff
changeset
|
1370 command -nargs=1 Comd echom <q-args> |
872239543313
patch 8.2.2299: Vim9: invalid memory access making error message flaky
Bram Moolenaar <Bram@vim.org>
parents:
23477
diff
changeset
|
1371 |
872239543313
patch 8.2.2299: Vim9: invalid memory access making error message flaky
Bram Moolenaar <Bram@vim.org>
parents:
23477
diff
changeset
|
1372 var lines =<< trim END |
24543
b3bd27751e09
patch 8.2.2811: Vim9: error for missing white space doesn't say where
Bram Moolenaar <Bram@vim.org>
parents:
24541
diff
changeset
|
1373 vim9script |
b3bd27751e09
patch 8.2.2811: Vim9: error for missing white space doesn't say where
Bram Moolenaar <Bram@vim.org>
parents:
24541
diff
changeset
|
1374 Comd # comment |
23513
872239543313
patch 8.2.2299: Vim9: invalid memory access making error message flaky
Bram Moolenaar <Bram@vim.org>
parents:
23477
diff
changeset
|
1375 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1376 v9.CheckScriptSuccess(lines) |
23513
872239543313
patch 8.2.2299: Vim9: invalid memory access making error message flaky
Bram Moolenaar <Bram@vim.org>
parents:
23477
diff
changeset
|
1377 |
872239543313
patch 8.2.2299: Vim9: invalid memory access making error message flaky
Bram Moolenaar <Bram@vim.org>
parents:
23477
diff
changeset
|
1378 lines =<< trim END |
24543
b3bd27751e09
patch 8.2.2811: Vim9: error for missing white space doesn't say where
Bram Moolenaar <Bram@vim.org>
parents:
24541
diff
changeset
|
1379 vim9script |
b3bd27751e09
patch 8.2.2811: Vim9: error for missing white space doesn't say where
Bram Moolenaar <Bram@vim.org>
parents:
24541
diff
changeset
|
1380 Comd# comment |
23513
872239543313
patch 8.2.2299: Vim9: invalid memory access making error message flaky
Bram Moolenaar <Bram@vim.org>
parents:
23477
diff
changeset
|
1381 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1382 v9.CheckScriptFailure(lines, 'E1144:') |
24543
b3bd27751e09
patch 8.2.2811: Vim9: error for missing white space doesn't say where
Bram Moolenaar <Bram@vim.org>
parents:
24541
diff
changeset
|
1383 delcommand Comd |
23513
872239543313
patch 8.2.2299: Vim9: invalid memory access making error message flaky
Bram Moolenaar <Bram@vim.org>
parents:
23477
diff
changeset
|
1384 |
24543
b3bd27751e09
patch 8.2.2811: Vim9: error for missing white space doesn't say where
Bram Moolenaar <Bram@vim.org>
parents:
24541
diff
changeset
|
1385 lines =<< trim END |
b3bd27751e09
patch 8.2.2811: Vim9: error for missing white space doesn't say where
Bram Moolenaar <Bram@vim.org>
parents:
24541
diff
changeset
|
1386 vim9script |
b3bd27751e09
patch 8.2.2811: Vim9: error for missing white space doesn't say where
Bram Moolenaar <Bram@vim.org>
parents:
24541
diff
changeset
|
1387 command Foo echo 'Foo' |
b3bd27751e09
patch 8.2.2811: Vim9: error for missing white space doesn't say where
Bram Moolenaar <Bram@vim.org>
parents:
24541
diff
changeset
|
1388 Foo3Bar |
b3bd27751e09
patch 8.2.2811: Vim9: error for missing white space doesn't say where
Bram Moolenaar <Bram@vim.org>
parents:
24541
diff
changeset
|
1389 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1390 v9.CheckScriptFailure(lines, 'E1144: Command "Foo" is not followed by white space: Foo3Bar') |
24543
b3bd27751e09
patch 8.2.2811: Vim9: error for missing white space doesn't say where
Bram Moolenaar <Bram@vim.org>
parents:
24541
diff
changeset
|
1391 |
b3bd27751e09
patch 8.2.2811: Vim9: error for missing white space doesn't say where
Bram Moolenaar <Bram@vim.org>
parents:
24541
diff
changeset
|
1392 delcommand Foo |
23513
872239543313
patch 8.2.2299: Vim9: invalid memory access making error message flaky
Bram Moolenaar <Bram@vim.org>
parents:
23477
diff
changeset
|
1393 enddef |
872239543313
patch 8.2.2299: Vim9: invalid memory access making error message flaky
Bram Moolenaar <Bram@vim.org>
parents:
23477
diff
changeset
|
1394 |
22950
1270401054d8
patch 8.2.2022: Vim9: star command recognized errornously
Bram Moolenaar <Bram@vim.org>
parents:
22860
diff
changeset
|
1395 def Test_star_command() |
1270401054d8
patch 8.2.2022: Vim9: star command recognized errornously
Bram Moolenaar <Bram@vim.org>
parents:
22860
diff
changeset
|
1396 var lines =<< trim END |
1270401054d8
patch 8.2.2022: Vim9: star command recognized errornously
Bram Moolenaar <Bram@vim.org>
parents:
22860
diff
changeset
|
1397 vim9script |
1270401054d8
patch 8.2.2022: Vim9: star command recognized errornously
Bram Moolenaar <Bram@vim.org>
parents:
22860
diff
changeset
|
1398 @s = 'g:success = 8' |
1270401054d8
patch 8.2.2022: Vim9: star command recognized errornously
Bram Moolenaar <Bram@vim.org>
parents:
22860
diff
changeset
|
1399 set cpo+=* |
1270401054d8
patch 8.2.2022: Vim9: star command recognized errornously
Bram Moolenaar <Bram@vim.org>
parents:
22860
diff
changeset
|
1400 exe '*s' |
1270401054d8
patch 8.2.2022: Vim9: star command recognized errornously
Bram Moolenaar <Bram@vim.org>
parents:
22860
diff
changeset
|
1401 assert_equal(8, g:success) |
1270401054d8
patch 8.2.2022: Vim9: star command recognized errornously
Bram Moolenaar <Bram@vim.org>
parents:
22860
diff
changeset
|
1402 unlet g:success |
1270401054d8
patch 8.2.2022: Vim9: star command recognized errornously
Bram Moolenaar <Bram@vim.org>
parents:
22860
diff
changeset
|
1403 set cpo-=* |
1270401054d8
patch 8.2.2022: Vim9: star command recognized errornously
Bram Moolenaar <Bram@vim.org>
parents:
22860
diff
changeset
|
1404 assert_fails("exe '*s'", 'E1050:') |
1270401054d8
patch 8.2.2022: Vim9: star command recognized errornously
Bram Moolenaar <Bram@vim.org>
parents:
22860
diff
changeset
|
1405 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1406 v9.CheckScriptSuccess(lines) |
22950
1270401054d8
patch 8.2.2022: Vim9: star command recognized errornously
Bram Moolenaar <Bram@vim.org>
parents:
22860
diff
changeset
|
1407 enddef |
1270401054d8
patch 8.2.2022: Vim9: star command recognized errornously
Bram Moolenaar <Bram@vim.org>
parents:
22860
diff
changeset
|
1408 |
23011
ec23d84a096d
patch 8.2.2052: Vim9: "edit +4 fname" gives an error
Bram Moolenaar <Bram@vim.org>
parents:
22950
diff
changeset
|
1409 def Test_cmd_argument_without_colon() |
ec23d84a096d
patch 8.2.2052: Vim9: "edit +4 fname" gives an error
Bram Moolenaar <Bram@vim.org>
parents:
22950
diff
changeset
|
1410 new Xfile |
ec23d84a096d
patch 8.2.2052: Vim9: "edit +4 fname" gives an error
Bram Moolenaar <Bram@vim.org>
parents:
22950
diff
changeset
|
1411 setline(1, ['a', 'b', 'c', 'd']) |
ec23d84a096d
patch 8.2.2052: Vim9: "edit +4 fname" gives an error
Bram Moolenaar <Bram@vim.org>
parents:
22950
diff
changeset
|
1412 write |
ec23d84a096d
patch 8.2.2052: Vim9: "edit +4 fname" gives an error
Bram Moolenaar <Bram@vim.org>
parents:
22950
diff
changeset
|
1413 edit +3 % |
ec23d84a096d
patch 8.2.2052: Vim9: "edit +4 fname" gives an error
Bram Moolenaar <Bram@vim.org>
parents:
22950
diff
changeset
|
1414 assert_equal(3, getcurpos()[1]) |
ec23d84a096d
patch 8.2.2052: Vim9: "edit +4 fname" gives an error
Bram Moolenaar <Bram@vim.org>
parents:
22950
diff
changeset
|
1415 edit +/a % |
ec23d84a096d
patch 8.2.2052: Vim9: "edit +4 fname" gives an error
Bram Moolenaar <Bram@vim.org>
parents:
22950
diff
changeset
|
1416 assert_equal(1, getcurpos()[1]) |
ec23d84a096d
patch 8.2.2052: Vim9: "edit +4 fname" gives an error
Bram Moolenaar <Bram@vim.org>
parents:
22950
diff
changeset
|
1417 bwipe |
ec23d84a096d
patch 8.2.2052: Vim9: "edit +4 fname" gives an error
Bram Moolenaar <Bram@vim.org>
parents:
22950
diff
changeset
|
1418 delete('Xfile') |
ec23d84a096d
patch 8.2.2052: Vim9: "edit +4 fname" gives an error
Bram Moolenaar <Bram@vim.org>
parents:
22950
diff
changeset
|
1419 enddef |
ec23d84a096d
patch 8.2.2052: Vim9: "edit +4 fname" gives an error
Bram Moolenaar <Bram@vim.org>
parents:
22950
diff
changeset
|
1420 |
23205
d998222d314d
patch 8.2.2148: Vim9: crash when user command doesn't match
Bram Moolenaar <Bram@vim.org>
parents:
23197
diff
changeset
|
1421 def Test_ambiguous_user_cmd() |
23513
872239543313
patch 8.2.2299: Vim9: invalid memory access making error message flaky
Bram Moolenaar <Bram@vim.org>
parents:
23477
diff
changeset
|
1422 command Cmd1 eval 0 |
872239543313
patch 8.2.2299: Vim9: invalid memory access making error message flaky
Bram Moolenaar <Bram@vim.org>
parents:
23477
diff
changeset
|
1423 command Cmd2 eval 0 |
23205
d998222d314d
patch 8.2.2148: Vim9: crash when user command doesn't match
Bram Moolenaar <Bram@vim.org>
parents:
23197
diff
changeset
|
1424 var lines =<< trim END |
d998222d314d
patch 8.2.2148: Vim9: crash when user command doesn't match
Bram Moolenaar <Bram@vim.org>
parents:
23197
diff
changeset
|
1425 Cmd |
d998222d314d
patch 8.2.2148: Vim9: crash when user command doesn't match
Bram Moolenaar <Bram@vim.org>
parents:
23197
diff
changeset
|
1426 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1427 v9.CheckDefAndScriptFailure(lines, 'E464:', 1) |
23513
872239543313
patch 8.2.2299: Vim9: invalid memory access making error message flaky
Bram Moolenaar <Bram@vim.org>
parents:
23477
diff
changeset
|
1428 delcommand Cmd1 |
872239543313
patch 8.2.2299: Vim9: invalid memory access making error message flaky
Bram Moolenaar <Bram@vim.org>
parents:
23477
diff
changeset
|
1429 delcommand Cmd2 |
23205
d998222d314d
patch 8.2.2148: Vim9: crash when user command doesn't match
Bram Moolenaar <Bram@vim.org>
parents:
23197
diff
changeset
|
1430 enddef |
d998222d314d
patch 8.2.2148: Vim9: crash when user command doesn't match
Bram Moolenaar <Bram@vim.org>
parents:
23197
diff
changeset
|
1431 |
23254
4b7e996354e0
patch 8.2.2173: Vim9: get internal error when assigning to undefined variable
Bram Moolenaar <Bram@vim.org>
parents:
23205
diff
changeset
|
1432 def Test_command_not_recognized() |
4b7e996354e0
patch 8.2.2173: Vim9: get internal error when assigning to undefined variable
Bram Moolenaar <Bram@vim.org>
parents:
23205
diff
changeset
|
1433 var lines =<< trim END |
4b7e996354e0
patch 8.2.2173: Vim9: get internal error when assigning to undefined variable
Bram Moolenaar <Bram@vim.org>
parents:
23205
diff
changeset
|
1434 d.key = 'asdf' |
4b7e996354e0
patch 8.2.2173: Vim9: get internal error when assigning to undefined variable
Bram Moolenaar <Bram@vim.org>
parents:
23205
diff
changeset
|
1435 END |
28281
bd1dcc605e58
patch 8.2.4666: Vim9: assignment not recognized in skipped block
Bram Moolenaar <Bram@vim.org>
parents:
28179
diff
changeset
|
1436 v9.CheckDefFailure(lines, 'E1089: Unknown variable: d', 1) |
bd1dcc605e58
patch 8.2.4666: Vim9: assignment not recognized in skipped block
Bram Moolenaar <Bram@vim.org>
parents:
28179
diff
changeset
|
1437 |
bd1dcc605e58
patch 8.2.4666: Vim9: assignment not recognized in skipped block
Bram Moolenaar <Bram@vim.org>
parents:
28179
diff
changeset
|
1438 lines =<< trim END |
bd1dcc605e58
patch 8.2.4666: Vim9: assignment not recognized in skipped block
Bram Moolenaar <Bram@vim.org>
parents:
28179
diff
changeset
|
1439 d['key'] = 'asdf' |
bd1dcc605e58
patch 8.2.4666: Vim9: assignment not recognized in skipped block
Bram Moolenaar <Bram@vim.org>
parents:
28179
diff
changeset
|
1440 END |
bd1dcc605e58
patch 8.2.4666: Vim9: assignment not recognized in skipped block
Bram Moolenaar <Bram@vim.org>
parents:
28179
diff
changeset
|
1441 v9.CheckDefFailure(lines, 'E1089: Unknown variable: d', 1) |
23254
4b7e996354e0
patch 8.2.2173: Vim9: get internal error when assigning to undefined variable
Bram Moolenaar <Bram@vim.org>
parents:
23205
diff
changeset
|
1442 |
4b7e996354e0
patch 8.2.2173: Vim9: get internal error when assigning to undefined variable
Bram Moolenaar <Bram@vim.org>
parents:
23205
diff
changeset
|
1443 lines =<< trim END |
27738
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1444 if 0 |
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1445 d.key = 'asdf' |
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1446 endif |
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1447 END |
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1448 v9.CheckDefSuccess(lines) |
23254
4b7e996354e0
patch 8.2.2173: Vim9: get internal error when assigning to undefined variable
Bram Moolenaar <Bram@vim.org>
parents:
23205
diff
changeset
|
1449 enddef |
21058
111f877e63d9
patch 8.2.1080: Vim9: no line break allowed in a for loop
Bram Moolenaar <Bram@vim.org>
parents:
21056
diff
changeset
|
1450 |
23272
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1451 def Test_magic_not_used() |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1452 new |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1453 for cmd in ['set magic', 'set nomagic'] |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1454 exe cmd |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1455 setline(1, 'aaa') |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1456 s/.../bbb/ |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1457 assert_equal('bbb', getline(1)) |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1458 endfor |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1459 |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1460 set magic |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1461 setline(1, 'aaa') |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1462 assert_fails('s/.\M../bbb/', 'E486:') |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1463 assert_fails('snomagic/.../bbb/', 'E486:') |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1464 assert_equal('aaa', getline(1)) |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1465 |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1466 bwipe! |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1467 enddef |
a84e7abb0c92
patch 8.2.2182: Vim9: value of 'magic' is still relevant
Bram Moolenaar <Bram@vim.org>
parents:
23254
diff
changeset
|
1468 |
23274
10bbff53d3d1
patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used
Bram Moolenaar <Bram@vim.org>
parents:
23272
diff
changeset
|
1469 def Test_gdefault_not_used() |
10bbff53d3d1
patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used
Bram Moolenaar <Bram@vim.org>
parents:
23272
diff
changeset
|
1470 new |
10bbff53d3d1
patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used
Bram Moolenaar <Bram@vim.org>
parents:
23272
diff
changeset
|
1471 for cmd in ['set gdefault', 'set nogdefault'] |
10bbff53d3d1
patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used
Bram Moolenaar <Bram@vim.org>
parents:
23272
diff
changeset
|
1472 exe cmd |
10bbff53d3d1
patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used
Bram Moolenaar <Bram@vim.org>
parents:
23272
diff
changeset
|
1473 setline(1, 'aaa') |
10bbff53d3d1
patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used
Bram Moolenaar <Bram@vim.org>
parents:
23272
diff
changeset
|
1474 s/./b/ |
10bbff53d3d1
patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used
Bram Moolenaar <Bram@vim.org>
parents:
23272
diff
changeset
|
1475 assert_equal('baa', getline(1)) |
10bbff53d3d1
patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used
Bram Moolenaar <Bram@vim.org>
parents:
23272
diff
changeset
|
1476 endfor |
10bbff53d3d1
patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used
Bram Moolenaar <Bram@vim.org>
parents:
23272
diff
changeset
|
1477 |
10bbff53d3d1
patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used
Bram Moolenaar <Bram@vim.org>
parents:
23272
diff
changeset
|
1478 set nogdefault |
10bbff53d3d1
patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used
Bram Moolenaar <Bram@vim.org>
parents:
23272
diff
changeset
|
1479 bwipe! |
10bbff53d3d1
patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used
Bram Moolenaar <Bram@vim.org>
parents:
23272
diff
changeset
|
1480 enddef |
10bbff53d3d1
patch 8.2.2183: Vim9: value of 'edcompatible' and 'gdefault' are used
Bram Moolenaar <Bram@vim.org>
parents:
23272
diff
changeset
|
1481 |
27464
a14c4d3e3260
patch 8.2.4260: Vim9: can still use a global function without g:
Bram Moolenaar <Bram@vim.org>
parents:
27457
diff
changeset
|
1482 def s:SomeComplFunc(findstart: number, base: string): any |
23374
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1483 if findstart |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1484 return 0 |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1485 else |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1486 return ['aaa', 'bbb'] |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1487 endif |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1488 enddef |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1489 |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1490 def Test_insert_complete() |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1491 # this was running into an error with the matchparen hack |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1492 new |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1493 set completefunc=SomeComplFunc |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1494 feedkeys("i\<c-x>\<c-u>\<Esc>", 'ntx') |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1495 assert_equal('aaa', getline(1)) |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1496 |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1497 set completefunc= |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1498 bwipe! |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1499 enddef |
1371e21fdc3d
patch 8.2.2230: Vim9: insert completion runs into error
Bram Moolenaar <Bram@vim.org>
parents:
23370
diff
changeset
|
1500 |
23477
95db03521b01
patch 8.2.2281: Vim9: compiled "wincmd" cannot be followed by bar
Bram Moolenaar <Bram@vim.org>
parents:
23428
diff
changeset
|
1501 def Test_wincmd() |
95db03521b01
patch 8.2.2281: Vim9: compiled "wincmd" cannot be followed by bar
Bram Moolenaar <Bram@vim.org>
parents:
23428
diff
changeset
|
1502 split |
95db03521b01
patch 8.2.2281: Vim9: compiled "wincmd" cannot be followed by bar
Bram Moolenaar <Bram@vim.org>
parents:
23428
diff
changeset
|
1503 var id1 = win_getid() |
95db03521b01
patch 8.2.2281: Vim9: compiled "wincmd" cannot be followed by bar
Bram Moolenaar <Bram@vim.org>
parents:
23428
diff
changeset
|
1504 if true |
95db03521b01
patch 8.2.2281: Vim9: compiled "wincmd" cannot be followed by bar
Bram Moolenaar <Bram@vim.org>
parents:
23428
diff
changeset
|
1505 try | wincmd w | catch | endtry |
95db03521b01
patch 8.2.2281: Vim9: compiled "wincmd" cannot be followed by bar
Bram Moolenaar <Bram@vim.org>
parents:
23428
diff
changeset
|
1506 endif |
95db03521b01
patch 8.2.2281: Vim9: compiled "wincmd" cannot be followed by bar
Bram Moolenaar <Bram@vim.org>
parents:
23428
diff
changeset
|
1507 assert_notequal(id1, win_getid()) |
95db03521b01
patch 8.2.2281: Vim9: compiled "wincmd" cannot be followed by bar
Bram Moolenaar <Bram@vim.org>
parents:
23428
diff
changeset
|
1508 close |
24216
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1509 |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1510 split |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1511 var id = win_getid() |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1512 split |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1513 :2wincmd o |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1514 assert_equal(id, win_getid()) |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1515 only |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1516 |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1517 split |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1518 split |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1519 assert_equal(3, winnr('$')) |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1520 :2wincmd c |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1521 assert_equal(2, winnr('$')) |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1522 only |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1523 |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1524 split |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1525 split |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1526 assert_equal(3, winnr('$')) |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1527 :2wincmd q |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1528 assert_equal(2, winnr('$')) |
77cb22562852
patch 8.2.2649: Vim9: some wincmd arguments cause a white space error
Bram Moolenaar <Bram@vim.org>
parents:
24124
diff
changeset
|
1529 only |
23477
95db03521b01
patch 8.2.2281: Vim9: compiled "wincmd" cannot be followed by bar
Bram Moolenaar <Bram@vim.org>
parents:
23428
diff
changeset
|
1530 enddef |
95db03521b01
patch 8.2.2281: Vim9: compiled "wincmd" cannot be followed by bar
Bram Moolenaar <Bram@vim.org>
parents:
23428
diff
changeset
|
1531 |
23580
dc3b7a31c29f
patch 8.2.2332: Vim9: missing :endif not reported when using :windo
Bram Moolenaar <Bram@vim.org>
parents:
23541
diff
changeset
|
1532 def Test_windo_missing_endif() |
dc3b7a31c29f
patch 8.2.2332: Vim9: missing :endif not reported when using :windo
Bram Moolenaar <Bram@vim.org>
parents:
23541
diff
changeset
|
1533 var lines =<< trim END |
dc3b7a31c29f
patch 8.2.2332: Vim9: missing :endif not reported when using :windo
Bram Moolenaar <Bram@vim.org>
parents:
23541
diff
changeset
|
1534 windo if 1 |
dc3b7a31c29f
patch 8.2.2332: Vim9: missing :endif not reported when using :windo
Bram Moolenaar <Bram@vim.org>
parents:
23541
diff
changeset
|
1535 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1536 v9.CheckDefExecFailure(lines, 'E171:', 1) |
23580
dc3b7a31c29f
patch 8.2.2332: Vim9: missing :endif not reported when using :windo
Bram Moolenaar <Bram@vim.org>
parents:
23541
diff
changeset
|
1537 enddef |
dc3b7a31c29f
patch 8.2.2332: Vim9: missing :endif not reported when using :windo
Bram Moolenaar <Bram@vim.org>
parents:
23541
diff
changeset
|
1538 |
24262
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1539 let s:theList = [1, 2, 3] |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1540 |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1541 def Test_lockvar() |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1542 s:theList[1] = 22 |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1543 assert_equal([1, 22, 3], s:theList) |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1544 lockvar s:theList |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1545 assert_fails('theList[1] = 77', 'E741:') |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1546 unlockvar s:theList |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1547 s:theList[1] = 44 |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1548 assert_equal([1, 44, 3], s:theList) |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1549 |
26660
2b17f87b7bd1
patch 8.2.3859: Vim9: some code lines not tested
Bram Moolenaar <Bram@vim.org>
parents:
26658
diff
changeset
|
1550 if 0 |
2b17f87b7bd1
patch 8.2.3859: Vim9: some code lines not tested
Bram Moolenaar <Bram@vim.org>
parents:
26658
diff
changeset
|
1551 lockvar whatever |
2b17f87b7bd1
patch 8.2.3859: Vim9: some code lines not tested
Bram Moolenaar <Bram@vim.org>
parents:
26658
diff
changeset
|
1552 endif |
2b17f87b7bd1
patch 8.2.3859: Vim9: some code lines not tested
Bram Moolenaar <Bram@vim.org>
parents:
26658
diff
changeset
|
1553 |
27394
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1554 g:lockme = [1, 2, 3] |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1555 lockvar 1 g:lockme |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1556 g:lockme[1] = 77 |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1557 assert_equal([1, 77, 3], g:lockme) |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1558 |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1559 lockvar 2 g:lockme |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1560 var caught = false |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1561 try |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1562 g:lockme[1] = 99 |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1563 catch /E1119:/ |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1564 caught = true |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1565 endtry |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1566 assert_true(caught) |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1567 assert_equal([1, 77, 3], g:lockme) |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1568 unlet g:lockme |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1569 |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1570 # also for non-materialized list |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1571 g:therange = range(3) |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1572 lockvar 2 g:therange |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1573 caught = false |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1574 try |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1575 g:therange[1] = 99 |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1576 catch /E1119:/ |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1577 caught = true |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1578 endtry |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1579 assert_true(caught) |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1580 assert_equal([0, 1, 2], g:therange) |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1581 unlet g:therange |
69a48bcd1d80
patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function
Bram Moolenaar <Bram@vim.org>
parents:
26660
diff
changeset
|
1582 |
27398
472bb63632bd
patch 8.2.4227: Vim9: using "lockvar!" in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
27394
diff
changeset
|
1583 # use exclamation mark for locking deeper |
472bb63632bd
patch 8.2.4227: Vim9: using "lockvar!" in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
27394
diff
changeset
|
1584 g:nestedlist = [1, [2, 3], 4] |
472bb63632bd
patch 8.2.4227: Vim9: using "lockvar!" in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
27394
diff
changeset
|
1585 lockvar! g:nestedlist |
472bb63632bd
patch 8.2.4227: Vim9: using "lockvar!" in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
27394
diff
changeset
|
1586 try |
472bb63632bd
patch 8.2.4227: Vim9: using "lockvar!" in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
27394
diff
changeset
|
1587 g:nestedlist[1][0] = 9 |
472bb63632bd
patch 8.2.4227: Vim9: using "lockvar!" in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
27394
diff
changeset
|
1588 catch /E1119:/ |
472bb63632bd
patch 8.2.4227: Vim9: using "lockvar!" in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
27394
diff
changeset
|
1589 caught = true |
472bb63632bd
patch 8.2.4227: Vim9: using "lockvar!" in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
27394
diff
changeset
|
1590 endtry |
472bb63632bd
patch 8.2.4227: Vim9: using "lockvar!" in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
27394
diff
changeset
|
1591 assert_true(caught) |
472bb63632bd
patch 8.2.4227: Vim9: using "lockvar!" in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
27394
diff
changeset
|
1592 unlet g:nestedlist |
472bb63632bd
patch 8.2.4227: Vim9: using "lockvar!" in :def function does not work
Bram Moolenaar <Bram@vim.org>
parents:
27394
diff
changeset
|
1593 |
25605
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1594 var d = {a: 1, b: 2} |
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1595 d.a = 3 |
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1596 d.b = 4 |
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1597 assert_equal({a: 3, b: 4}, d) |
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1598 lockvar d.a |
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1599 d.b = 5 |
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1600 var ex = '' |
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1601 try |
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1602 d.a = 6 |
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1603 catch |
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1604 ex = v:exception |
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1605 endtry |
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1606 assert_match('E1121:', ex) |
27539
ce4c2f4ce1f9
patch 8.2.4296: Vim9: not all code covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27529
diff
changeset
|
1607 unlockvar d['a'] |
25605
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1608 d.a = 7 |
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1609 assert_equal({a: 7, b: 5}, d) |
6f13d9ea0d04
patch 8.2.3339: Vim9: cannot lock a member in a local dict
Bram Moolenaar <Bram@vim.org>
parents:
25575
diff
changeset
|
1610 |
28305
c4b2aa8e1ee1
patch 8.2.4678: Vim9: not all code is tested
Bram Moolenaar <Bram@vim.org>
parents:
28281
diff
changeset
|
1611 caught = false |
c4b2aa8e1ee1
patch 8.2.4678: Vim9: not all code is tested
Bram Moolenaar <Bram@vim.org>
parents:
28281
diff
changeset
|
1612 try |
c4b2aa8e1ee1
patch 8.2.4678: Vim9: not all code is tested
Bram Moolenaar <Bram@vim.org>
parents:
28281
diff
changeset
|
1613 lockvar d.c |
c4b2aa8e1ee1
patch 8.2.4678: Vim9: not all code is tested
Bram Moolenaar <Bram@vim.org>
parents:
28281
diff
changeset
|
1614 catch /E716/ |
c4b2aa8e1ee1
patch 8.2.4678: Vim9: not all code is tested
Bram Moolenaar <Bram@vim.org>
parents:
28281
diff
changeset
|
1615 caught = true |
c4b2aa8e1ee1
patch 8.2.4678: Vim9: not all code is tested
Bram Moolenaar <Bram@vim.org>
parents:
28281
diff
changeset
|
1616 endtry |
c4b2aa8e1ee1
patch 8.2.4678: Vim9: not all code is tested
Bram Moolenaar <Bram@vim.org>
parents:
28281
diff
changeset
|
1617 assert_true(caught) |
c4b2aa8e1ee1
patch 8.2.4678: Vim9: not all code is tested
Bram Moolenaar <Bram@vim.org>
parents:
28281
diff
changeset
|
1618 |
24262
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1619 var lines =<< trim END |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1620 vim9script |
27762
3196066c5795
patch 8.2.4407: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27738
diff
changeset
|
1621 g:bl = 0z1122 |
3196066c5795
patch 8.2.4407: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27738
diff
changeset
|
1622 lockvar g:bl |
3196066c5795
patch 8.2.4407: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27738
diff
changeset
|
1623 def Tryit() |
3196066c5795
patch 8.2.4407: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27738
diff
changeset
|
1624 g:bl[1] = 99 |
3196066c5795
patch 8.2.4407: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27738
diff
changeset
|
1625 enddef |
3196066c5795
patch 8.2.4407: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27738
diff
changeset
|
1626 Tryit() |
3196066c5795
patch 8.2.4407: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27738
diff
changeset
|
1627 END |
3196066c5795
patch 8.2.4407: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27738
diff
changeset
|
1628 v9.CheckScriptFailure(lines, 'E741:', 1) |
3196066c5795
patch 8.2.4407: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27738
diff
changeset
|
1629 |
3196066c5795
patch 8.2.4407: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27738
diff
changeset
|
1630 lines =<< trim END |
3196066c5795
patch 8.2.4407: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27738
diff
changeset
|
1631 vim9script |
24262
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1632 var theList = [1, 2, 3] |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1633 def SetList() |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1634 theList[1] = 22 |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1635 assert_equal([1, 22, 3], theList) |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1636 lockvar theList |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1637 theList[1] = 77 |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1638 enddef |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1639 SetList() |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1640 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1641 v9.CheckScriptFailure(lines, 'E1119', 4) |
24262
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1642 |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1643 lines =<< trim END |
27768
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1644 vim9script |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1645 var theList = [1, 2, 3] |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1646 def AddToList() |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1647 lockvar theList |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1648 theList += [4] |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1649 enddef |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1650 AddToList() |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1651 END |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1652 v9.CheckScriptFailure(lines, 'E741', 2) |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1653 |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1654 lines =<< trim END |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1655 vim9script |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1656 var theList = [1, 2, 3] |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1657 def AddToList() |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1658 lockvar theList |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1659 add(theList, 4) |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1660 enddef |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1661 AddToList() |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1662 END |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1663 v9.CheckScriptFailure(lines, 'E741', 2) |
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1664 |
28152
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1665 # can unlet a locked list item but not change it |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1666 lines =<< trim END |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1667 var ll = [1, 2, 3] |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1668 lockvar ll[1] |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1669 unlet ll[1] |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1670 assert_equal([1, 3], ll) |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1671 END |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1672 v9.CheckDefAndScriptSuccess(lines) |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1673 lines =<< trim END |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1674 var ll = [1, 2, 3] |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1675 lockvar ll[1] |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1676 ll[1] = 9 |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1677 END |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1678 v9.CheckDefExecAndScriptFailure(lines, ['E1119:', 'E741'], 3) |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1679 |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1680 # can unlet a locked dict item but not change it |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1681 lines =<< trim END |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1682 var dd = {a: 1, b: 2} |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1683 lockvar dd.a |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1684 unlet dd.a |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1685 assert_equal({b: 2}, dd) |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1686 END |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1687 v9.CheckDefAndScriptSuccess(lines) |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1688 lines =<< trim END |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1689 var dd = {a: 1, b: 2} |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1690 lockvar dd.a |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1691 dd.a = 3 |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1692 END |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1693 v9.CheckDefExecAndScriptFailure(lines, ['E1121:', 'E741'], 3) |
b96409b84eaf
patch 8.2.4600: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28055
diff
changeset
|
1694 |
27768
b081ba78675a
patch 8.2.4410: Vim9: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27762
diff
changeset
|
1695 lines =<< trim END |
24262
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1696 var theList = [1, 2, 3] |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1697 lockvar theList |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1698 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1699 v9.CheckDefFailure(lines, 'E1178', 2) |
24262
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1700 |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1701 lines =<< trim END |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1702 var theList = [1, 2, 3] |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1703 unlockvar theList |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1704 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1705 v9.CheckDefFailure(lines, 'E1178', 2) |
26240
640b62dbf6cb
patch 8.2.3651: Vim9: no error for :lock or :unlock with unknown variable
Bram Moolenaar <Bram@vim.org>
parents:
26228
diff
changeset
|
1706 |
640b62dbf6cb
patch 8.2.3651: Vim9: no error for :lock or :unlock with unknown variable
Bram Moolenaar <Bram@vim.org>
parents:
26228
diff
changeset
|
1707 lines =<< trim END |
640b62dbf6cb
patch 8.2.3651: Vim9: no error for :lock or :unlock with unknown variable
Bram Moolenaar <Bram@vim.org>
parents:
26228
diff
changeset
|
1708 vim9script |
640b62dbf6cb
patch 8.2.3651: Vim9: no error for :lock or :unlock with unknown variable
Bram Moolenaar <Bram@vim.org>
parents:
26228
diff
changeset
|
1709 var name = 'john' |
640b62dbf6cb
patch 8.2.3651: Vim9: no error for :lock or :unlock with unknown variable
Bram Moolenaar <Bram@vim.org>
parents:
26228
diff
changeset
|
1710 lockvar nameX |
640b62dbf6cb
patch 8.2.3651: Vim9: no error for :lock or :unlock with unknown variable
Bram Moolenaar <Bram@vim.org>
parents:
26228
diff
changeset
|
1711 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1712 v9.CheckScriptFailure(lines, 'E1246', 3) |
26240
640b62dbf6cb
patch 8.2.3651: Vim9: no error for :lock or :unlock with unknown variable
Bram Moolenaar <Bram@vim.org>
parents:
26228
diff
changeset
|
1713 |
640b62dbf6cb
patch 8.2.3651: Vim9: no error for :lock or :unlock with unknown variable
Bram Moolenaar <Bram@vim.org>
parents:
26228
diff
changeset
|
1714 lines =<< trim END |
640b62dbf6cb
patch 8.2.3651: Vim9: no error for :lock or :unlock with unknown variable
Bram Moolenaar <Bram@vim.org>
parents:
26228
diff
changeset
|
1715 vim9script |
640b62dbf6cb
patch 8.2.3651: Vim9: no error for :lock or :unlock with unknown variable
Bram Moolenaar <Bram@vim.org>
parents:
26228
diff
changeset
|
1716 var name = 'john' |
640b62dbf6cb
patch 8.2.3651: Vim9: no error for :lock or :unlock with unknown variable
Bram Moolenaar <Bram@vim.org>
parents:
26228
diff
changeset
|
1717 def LockIt() |
640b62dbf6cb
patch 8.2.3651: Vim9: no error for :lock or :unlock with unknown variable
Bram Moolenaar <Bram@vim.org>
parents:
26228
diff
changeset
|
1718 lockvar nameX |
640b62dbf6cb
patch 8.2.3651: Vim9: no error for :lock or :unlock with unknown variable
Bram Moolenaar <Bram@vim.org>
parents:
26228
diff
changeset
|
1719 enddef |
640b62dbf6cb
patch 8.2.3651: Vim9: no error for :lock or :unlock with unknown variable
Bram Moolenaar <Bram@vim.org>
parents:
26228
diff
changeset
|
1720 LockIt() |
640b62dbf6cb
patch 8.2.3651: Vim9: no error for :lock or :unlock with unknown variable
Bram Moolenaar <Bram@vim.org>
parents:
26228
diff
changeset
|
1721 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1722 v9.CheckScriptFailure(lines, 'E1246', 1) |
28313
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1723 |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1724 lines =<< trim END |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1725 vim9script |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1726 const name = 'john' |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1727 unlockvar name |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1728 END |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1729 v9.CheckScriptFailure(lines, 'E46', 3) |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1730 |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1731 lines =<< trim END |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1732 vim9script |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1733 const name = 'john' |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1734 def UnLockIt() |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1735 unlockvar name |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1736 enddef |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1737 UnLockIt() |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1738 END |
b418e073b42f
patch 8.2.4682: Vim9: can use :unlockvar for const variable
Bram Moolenaar <Bram@vim.org>
parents:
28305
diff
changeset
|
1739 v9.CheckScriptFailure(lines, 'E46', 1) |
24262
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1740 enddef |
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
1741 |
24488
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1742 def Test_substitute_expr() |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1743 var to = 'repl' |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1744 new |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1745 setline(1, 'one from two') |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1746 s/from/\=to |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1747 assert_equal('one repl two', getline(1)) |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1748 |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1749 setline(1, 'one from two') |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1750 s/from/\=to .. '_x' |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1751 assert_equal('one repl_x two', getline(1)) |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1752 |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1753 setline(1, 'one from two from three') |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1754 var also = 'also' |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1755 s/from/\=to .. '_' .. also/g#e |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1756 assert_equal('one repl_also two repl_also three', getline(1)) |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1757 |
24498
bfa495227ac6
patch 8.2.2789: Vim9: using =expr in :substitute does not handle jumps
Bram Moolenaar <Bram@vim.org>
parents:
24490
diff
changeset
|
1758 setline(1, 'abc abc abc') |
bfa495227ac6
patch 8.2.2789: Vim9: using =expr in :substitute does not handle jumps
Bram Moolenaar <Bram@vim.org>
parents:
24490
diff
changeset
|
1759 for choice in [true, false] |
bfa495227ac6
patch 8.2.2789: Vim9: using =expr in :substitute does not handle jumps
Bram Moolenaar <Bram@vim.org>
parents:
24490
diff
changeset
|
1760 :1s/abc/\=choice ? 'yes' : 'no'/ |
bfa495227ac6
patch 8.2.2789: Vim9: using =expr in :substitute does not handle jumps
Bram Moolenaar <Bram@vim.org>
parents:
24490
diff
changeset
|
1761 endfor |
bfa495227ac6
patch 8.2.2789: Vim9: using =expr in :substitute does not handle jumps
Bram Moolenaar <Bram@vim.org>
parents:
24490
diff
changeset
|
1762 assert_equal('yes no abc', getline(1)) |
bfa495227ac6
patch 8.2.2789: Vim9: using =expr in :substitute does not handle jumps
Bram Moolenaar <Bram@vim.org>
parents:
24490
diff
changeset
|
1763 |
28623
1d92ba691dc4
patch 8.2.4835: Vim9: some lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
28313
diff
changeset
|
1764 setline(1, 'from') |
1d92ba691dc4
patch 8.2.4835: Vim9: some lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
28313
diff
changeset
|
1765 v9.CheckDefExecFailure(['s/from/\=g:notexist/'], 'E121: Undefined variable: g:notexist') |
1d92ba691dc4
patch 8.2.4835: Vim9: some lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
28313
diff
changeset
|
1766 |
24541
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1767 bwipe! |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1768 |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1769 v9.CheckDefFailure(['s/from/\="x")/'], 'E488:') |
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1770 v9.CheckDefFailure(['s/from/\="x"/9'], 'E488:') |
24488
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1771 |
28154
ae975c8d5438
patch 8.2.4601: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28152
diff
changeset
|
1772 v9.CheckDefExecFailure(['s/this/\="that"/'], 'E486:') |
ae975c8d5438
patch 8.2.4601: Vim9: not enough test coverage for executing :def function
Bram Moolenaar <Bram@vim.org>
parents:
28152
diff
changeset
|
1773 |
24541
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1774 # When calling a function the right instruction list needs to be restored. |
24545
fe29b220eece
patch 8.2.2812: Vim9: still crash when using substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24543
diff
changeset
|
1775 g:cond = true |
24541
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1776 var lines =<< trim END |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1777 vim9script |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1778 def Foo() |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1779 Bar([]) |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1780 enddef |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1781 def Bar(l: list<number>) |
24545
fe29b220eece
patch 8.2.2812: Vim9: still crash when using substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24543
diff
changeset
|
1782 if g:cond |
24541
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1783 s/^/\=Rep()/ |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1784 for n in l[:] |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1785 endfor |
24545
fe29b220eece
patch 8.2.2812: Vim9: still crash when using substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24543
diff
changeset
|
1786 endif |
24541
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1787 enddef |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1788 def Rep(): string |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1789 return 'rep' |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1790 enddef |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1791 new |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1792 Foo() |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1793 assert_equal('rep', getline(1)) |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1794 bwipe! |
df90c61c306c
patch 8.2.2810: Vim9: crash when calling a function in a substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24516
diff
changeset
|
1795 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1796 v9.CheckScriptSuccess(lines) |
24545
fe29b220eece
patch 8.2.2812: Vim9: still crash when using substitute expression
Bram Moolenaar <Bram@vim.org>
parents:
24543
diff
changeset
|
1797 unlet g:cond |
24816
1bed37e82c2e
patch 8.2.2946: Vim9: substitute expression cannot be a List
Bram Moolenaar <Bram@vim.org>
parents:
24806
diff
changeset
|
1798 |
1bed37e82c2e
patch 8.2.2946: Vim9: substitute expression cannot be a List
Bram Moolenaar <Bram@vim.org>
parents:
24806
diff
changeset
|
1799 # List results in multiple lines |
1bed37e82c2e
patch 8.2.2946: Vim9: substitute expression cannot be a List
Bram Moolenaar <Bram@vim.org>
parents:
24806
diff
changeset
|
1800 new |
1bed37e82c2e
patch 8.2.2946: Vim9: substitute expression cannot be a List
Bram Moolenaar <Bram@vim.org>
parents:
24806
diff
changeset
|
1801 setline(1, 'some text here') |
25485
7d24fdd18672
patch 8.2.3279: Vim9: cannot use block in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
25374
diff
changeset
|
1802 s/text/\=['aaa', 'bbb', 'ccc']/ |
24816
1bed37e82c2e
patch 8.2.2946: Vim9: substitute expression cannot be a List
Bram Moolenaar <Bram@vim.org>
parents:
24806
diff
changeset
|
1803 assert_equal(['some aaa', 'bbb', 'ccc', ' here'], getline(1, '$')) |
1bed37e82c2e
patch 8.2.2946: Vim9: substitute expression cannot be a List
Bram Moolenaar <Bram@vim.org>
parents:
24806
diff
changeset
|
1804 bwipe! |
27738
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1805 |
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1806 # inside "if 0" substitute is ignored |
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1807 if 0 |
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1808 s/a/\=nothing/ and | some more |
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1809 endif |
24488
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1810 enddef |
f293bb501b30
patch 8.2.2784: Vim9: cannot use =expr in :substitute
Bram Moolenaar <Bram@vim.org>
parents:
24262
diff
changeset
|
1811 |
24490
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1812 def Test_redir_to_var() |
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1813 var result: string |
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1814 redir => result |
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1815 echo 'something' |
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1816 redir END |
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1817 assert_equal("\nsomething", result) |
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1818 |
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1819 redir =>> result |
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1820 echo 'more' |
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1821 redir END |
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1822 assert_equal("\nsomething\nmore", result) |
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1823 |
24512
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1824 var d: dict<string> |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1825 redir => d.redir |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1826 echo 'dict' |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1827 redir END |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1828 assert_equal({redir: "\ndict"}, d) |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1829 |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1830 var l = ['a', 'b', 'c'] |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1831 redir => l[1] |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1832 echo 'list' |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1833 redir END |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1834 assert_equal(['a', "\nlist", 'c'], l) |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1835 |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1836 var dl = {l: ['x']} |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1837 redir => dl.l[0] |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1838 echo 'dict-list' |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1839 redir END |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1840 assert_equal({l: ["\ndict-list"]}, dl) |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1841 |
24516
056f954c6fd2
patch 8.2.2798: Vim9: redir to variable with append does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24512
diff
changeset
|
1842 redir =>> d.redir |
056f954c6fd2
patch 8.2.2798: Vim9: redir to variable with append does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24512
diff
changeset
|
1843 echo 'more' |
056f954c6fd2
patch 8.2.2798: Vim9: redir to variable with append does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24512
diff
changeset
|
1844 redir END |
056f954c6fd2
patch 8.2.2798: Vim9: redir to variable with append does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24512
diff
changeset
|
1845 assert_equal({redir: "\ndict\nmore"}, d) |
056f954c6fd2
patch 8.2.2798: Vim9: redir to variable with append does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24512
diff
changeset
|
1846 |
24490
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1847 var lines =<< trim END |
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1848 redir => notexist |
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1849 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1850 v9.CheckDefFailure(lines, 'E1089:') |
24512
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1851 |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1852 lines =<< trim END |
27738
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1853 var text: string |
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1854 redir => text |
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1855 END |
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1856 v9.CheckDefFailure(lines, 'E1185:') |
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1857 |
d754ac2f5ac5
patch 8.2.4395: some code lines not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
27716
diff
changeset
|
1858 lines =<< trim END |
24512
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1859 var ls = 'asdf' |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1860 redir => ls[1] |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1861 redir END |
53871095bb65
patch 8.2.2796: Vim9: redir to variable does not accept an index
Bram Moolenaar <Bram@vim.org>
parents:
24498
diff
changeset
|
1862 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1863 v9.CheckDefFailure(lines, 'E1141:') |
26658
ed73553992bf
patch 8.2.3858: Vim9: not enough tests
Bram Moolenaar <Bram@vim.org>
parents:
26650
diff
changeset
|
1864 |
ed73553992bf
patch 8.2.3858: Vim9: not enough tests
Bram Moolenaar <Bram@vim.org>
parents:
26650
diff
changeset
|
1865 lines =<< trim END |
ed73553992bf
patch 8.2.3858: Vim9: not enough tests
Bram Moolenaar <Bram@vim.org>
parents:
26650
diff
changeset
|
1866 var text: string |
ed73553992bf
patch 8.2.3858: Vim9: not enough tests
Bram Moolenaar <Bram@vim.org>
parents:
26650
diff
changeset
|
1867 redir => text |
ed73553992bf
patch 8.2.3858: Vim9: not enough tests
Bram Moolenaar <Bram@vim.org>
parents:
26650
diff
changeset
|
1868 echo 'hello' |
ed73553992bf
patch 8.2.3858: Vim9: not enough tests
Bram Moolenaar <Bram@vim.org>
parents:
26650
diff
changeset
|
1869 redir > Xfile |
ed73553992bf
patch 8.2.3858: Vim9: not enough tests
Bram Moolenaar <Bram@vim.org>
parents:
26650
diff
changeset
|
1870 redir END |
ed73553992bf
patch 8.2.3858: Vim9: not enough tests
Bram Moolenaar <Bram@vim.org>
parents:
26650
diff
changeset
|
1871 END |
27529 | 1872 v9.CheckDefFailure(lines, 'E1092:') |
26658
ed73553992bf
patch 8.2.3858: Vim9: not enough tests
Bram Moolenaar <Bram@vim.org>
parents:
26650
diff
changeset
|
1873 |
ed73553992bf
patch 8.2.3858: Vim9: not enough tests
Bram Moolenaar <Bram@vim.org>
parents:
26650
diff
changeset
|
1874 lines =<< trim END |
ed73553992bf
patch 8.2.3858: Vim9: not enough tests
Bram Moolenaar <Bram@vim.org>
parents:
26650
diff
changeset
|
1875 var text: number |
ed73553992bf
patch 8.2.3858: Vim9: not enough tests
Bram Moolenaar <Bram@vim.org>
parents:
26650
diff
changeset
|
1876 redir => text |
ed73553992bf
patch 8.2.3858: Vim9: not enough tests
Bram Moolenaar <Bram@vim.org>
parents:
26650
diff
changeset
|
1877 echo 'hello' |
ed73553992bf
patch 8.2.3858: Vim9: not enough tests
Bram Moolenaar <Bram@vim.org>
parents:
26650
diff
changeset
|
1878 redir END |
ed73553992bf
patch 8.2.3858: Vim9: not enough tests
Bram Moolenaar <Bram@vim.org>
parents:
26650
diff
changeset
|
1879 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1880 v9.CheckDefFailure(lines, 'E1012:') |
24490
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1881 enddef |
08050e45bd06
patch 8.2.2785: Vim9: cannot redirect to local variable
Bram Moolenaar <Bram@vim.org>
parents:
24488
diff
changeset
|
1882 |
24614
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1883 def Test_echo_void() |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1884 var lines =<< trim END |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1885 vim9script |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1886 def NoReturn() |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1887 echo 'nothing' |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1888 enddef |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1889 echo NoReturn() |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1890 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1891 v9.CheckScriptFailure(lines, 'E1186:', 5) |
24614
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1892 |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1893 lines =<< trim END |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1894 vim9script |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1895 def NoReturn() |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1896 echo 'nothing' |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1897 enddef |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1898 def Try() |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1899 echo NoReturn() |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1900 enddef |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1901 defcompile |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1902 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1903 v9.CheckScriptFailure(lines, 'E1186:', 1) |
24614
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1904 enddef |
07b3d21a8b4b
patch 8.2.2846: Vim9: "echo Func()" does not give an error for using void
Bram Moolenaar <Bram@vim.org>
parents:
24596
diff
changeset
|
1905 |
25485
7d24fdd18672
patch 8.2.3279: Vim9: cannot use block in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
25374
diff
changeset
|
1906 def Test_cmdwin_block() |
7d24fdd18672
patch 8.2.3279: Vim9: cannot use block in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
25374
diff
changeset
|
1907 augroup justTesting |
7d24fdd18672
patch 8.2.3279: Vim9: cannot use block in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
25374
diff
changeset
|
1908 autocmd BufEnter * { |
7d24fdd18672
patch 8.2.3279: Vim9: cannot use block in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
25374
diff
changeset
|
1909 echomsg 'in block' |
7d24fdd18672
patch 8.2.3279: Vim9: cannot use block in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
25374
diff
changeset
|
1910 } |
7d24fdd18672
patch 8.2.3279: Vim9: cannot use block in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
25374
diff
changeset
|
1911 augroup END |
7d24fdd18672
patch 8.2.3279: Vim9: cannot use block in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
25374
diff
changeset
|
1912 feedkeys('q:', 'xt') |
7d24fdd18672
patch 8.2.3279: Vim9: cannot use block in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
25374
diff
changeset
|
1913 redraw |
7d24fdd18672
patch 8.2.3279: Vim9: cannot use block in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
25374
diff
changeset
|
1914 feedkeys("aclose\<CR>", 'xt') |
7d24fdd18672
patch 8.2.3279: Vim9: cannot use block in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
25374
diff
changeset
|
1915 |
7d24fdd18672
patch 8.2.3279: Vim9: cannot use block in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
25374
diff
changeset
|
1916 au! justTesting |
7d24fdd18672
patch 8.2.3279: Vim9: cannot use block in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
25374
diff
changeset
|
1917 enddef |
7d24fdd18672
patch 8.2.3279: Vim9: cannot use block in cmdline window
Bram Moolenaar <Bram@vim.org>
parents:
25374
diff
changeset
|
1918 |
25939
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1919 def Test_var_not_cmd() |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1920 var lines =<< trim END |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1921 g:notexist:cmd |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1922 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1923 v9.CheckDefAndScriptFailure(lines, ['E488: Trailing characters: :cmd', 'E121: Undefined variable: g:notexist'], 1) |
25939
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1924 |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1925 lines =<< trim END |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1926 g-pat-cmd |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1927 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1928 v9.CheckDefAndScriptFailure(lines, 'E1241:', 1) |
25949
d9f9cdb2337e
patch 8.2.3508: Vim9: bad separators for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25945
diff
changeset
|
1929 lines =<< trim END |
d9f9cdb2337e
patch 8.2.3508: Vim9: bad separators for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25945
diff
changeset
|
1930 g.pat.cmd |
d9f9cdb2337e
patch 8.2.3508: Vim9: bad separators for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25945
diff
changeset
|
1931 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1932 v9.CheckDefAndScriptFailure(lines, ['E1001: Variable not found: g', 'E121: Undefined variable: g'], 1) |
25939
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1933 |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1934 lines =<< trim END |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1935 s:notexist:repl |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1936 END |
27669
5c4ab8d4472c
patch 8.2.4360: Vim9: allowing use of "s:" leads to inconsistencies
Bram Moolenaar <Bram@vim.org>
parents:
27663
diff
changeset
|
1937 v9.CheckDefAndScriptFailure(lines, ['E488: Trailing characters: :repl', 'E1268:'], 1) |
5c4ab8d4472c
patch 8.2.4360: Vim9: allowing use of "s:" leads to inconsistencies
Bram Moolenaar <Bram@vim.org>
parents:
27663
diff
changeset
|
1938 |
5c4ab8d4472c
patch 8.2.4360: Vim9: allowing use of "s:" leads to inconsistencies
Bram Moolenaar <Bram@vim.org>
parents:
27663
diff
changeset
|
1939 lines =<< trim END |
5c4ab8d4472c
patch 8.2.4360: Vim9: allowing use of "s:" leads to inconsistencies
Bram Moolenaar <Bram@vim.org>
parents:
27663
diff
changeset
|
1940 notexist:repl |
5c4ab8d4472c
patch 8.2.4360: Vim9: allowing use of "s:" leads to inconsistencies
Bram Moolenaar <Bram@vim.org>
parents:
27663
diff
changeset
|
1941 END |
5c4ab8d4472c
patch 8.2.4360: Vim9: allowing use of "s:" leads to inconsistencies
Bram Moolenaar <Bram@vim.org>
parents:
27663
diff
changeset
|
1942 v9.CheckDefAndScriptFailure(lines, ['E476:', 'E492:'], 1) |
25939
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1943 |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1944 lines =<< trim END |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1945 s-pat-repl |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1946 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1947 v9.CheckDefAndScriptFailure(lines, 'E1241:', 1) |
25949
d9f9cdb2337e
patch 8.2.3508: Vim9: bad separators for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25945
diff
changeset
|
1948 lines =<< trim END |
d9f9cdb2337e
patch 8.2.3508: Vim9: bad separators for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25945
diff
changeset
|
1949 s.pat.repl |
d9f9cdb2337e
patch 8.2.3508: Vim9: bad separators for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25945
diff
changeset
|
1950 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1951 v9.CheckDefAndScriptFailure(lines, ['E1001: Variable not found: s', 'E121: Undefined variable: s'], 1) |
25939
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1952 |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1953 lines =<< trim END |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1954 w:notexist->len() |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1955 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1956 v9.CheckDefExecAndScriptFailure(lines, 'E121: Undefined variable: w:notexist', 1) |
25939
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1957 |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1958 lines =<< trim END |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1959 b:notexist->len() |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1960 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1961 v9.CheckDefExecAndScriptFailure(lines, 'E121: Undefined variable: b:notexist', 1) |
25939
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1962 |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1963 lines =<< trim END |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1964 t:notexist->len() |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1965 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1966 v9.CheckDefExecAndScriptFailure(lines, 'E121: Undefined variable: t:notexist', 1) |
25939
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1967 enddef |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1968 |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1969 def Test_no_space_after_command() |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1970 var lines =<< trim END |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1971 g /pat/cmd |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1972 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1973 v9.CheckDefAndScriptFailure(lines, 'E1242:', 1) |
25945
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
1974 lines =<< trim END |
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
1975 g #pat#cmd |
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
1976 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1977 v9.CheckDefAndScriptFailure(lines, 'E1242:', 1) |
27964
c31bee906b7a
patch 8.2.4507: test fails because of new error message
Bram Moolenaar <Bram@vim.org>
parents:
27768
diff
changeset
|
1978 |
c31bee906b7a
patch 8.2.4507: test fails because of new error message
Bram Moolenaar <Bram@vim.org>
parents:
27768
diff
changeset
|
1979 new |
c31bee906b7a
patch 8.2.4507: test fails because of new error message
Bram Moolenaar <Bram@vim.org>
parents:
27768
diff
changeset
|
1980 setline(1, 'some pat') |
25945
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
1981 lines =<< trim END |
27964
c31bee906b7a
patch 8.2.4507: test fails because of new error message
Bram Moolenaar <Bram@vim.org>
parents:
27768
diff
changeset
|
1982 g#pat#print |
25945
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
1983 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1984 v9.CheckDefAndScriptSuccess(lines) |
25945
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
1985 lines =<< trim END |
27964
c31bee906b7a
patch 8.2.4507: test fails because of new error message
Bram Moolenaar <Bram@vim.org>
parents:
27768
diff
changeset
|
1986 g# pat#print |
25945
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
1987 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1988 v9.CheckDefAndScriptSuccess(lines) |
27964
c31bee906b7a
patch 8.2.4507: test fails because of new error message
Bram Moolenaar <Bram@vim.org>
parents:
27768
diff
changeset
|
1989 bwipe! |
25939
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1990 |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1991 lines =<< trim END |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1992 s /pat/repl |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
1993 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1994 v9.CheckDefAndScriptFailure(lines, 'E1242:', 1) |
25945
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
1995 lines =<< trim END |
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
1996 s #pat#repl |
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
1997 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
1998 v9.CheckDefAndScriptFailure(lines, 'E1242:', 1) |
25945
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
1999 lines =<< trim END |
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
2000 s#pat#repl |
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
2001 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
2002 v9.CheckDefExecAndScriptFailure(lines, 'E486:', 1) |
25945
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
2003 lines =<< trim END |
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
2004 s# pat#repl |
39901825dd61
patch 8.2.3506: Vim9: special cases for "g" and "s" insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
25939
diff
changeset
|
2005 END |
27457
4c16acb2525f
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
27398
diff
changeset
|
2006 v9.CheckDefExecAndScriptFailure(lines, 'E486:', 1) |
25939
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
2007 enddef |
377a7686a52f
patch 8.2.3503: Vim9: using g:pat:cmd is confusing
Bram Moolenaar <Bram@vim.org>
parents:
25680
diff
changeset
|
2008 |
26145
3da380450cce
patch 8.2.3605: cannot clear and unlinke a highlight group with hlset()
Bram Moolenaar <Bram@vim.org>
parents:
26127
diff
changeset
|
2009 " Test for the 'previewpopup' option |
3da380450cce
patch 8.2.3605: cannot clear and unlinke a highlight group with hlset()
Bram Moolenaar <Bram@vim.org>
parents:
26127
diff
changeset
|
2010 def Test_previewpopup() |
26127
80e69293217c
patch 8.2.3596: crash when using :pedit in Vim9 script
Bram Moolenaar <Bram@vim.org>
parents:
25949
diff
changeset
|
2011 set previewpopup=height:10,width:60 |
80e69293217c
patch 8.2.3596: crash when using :pedit in Vim9 script
Bram Moolenaar <Bram@vim.org>
parents:
25949
diff
changeset
|
2012 pedit Xfile |
80e69293217c
patch 8.2.3596: crash when using :pedit in Vim9 script
Bram Moolenaar <Bram@vim.org>
parents:
25949
diff
changeset
|
2013 var id = popup_findpreview() |
80e69293217c
patch 8.2.3596: crash when using :pedit in Vim9 script
Bram Moolenaar <Bram@vim.org>
parents:
25949
diff
changeset
|
2014 assert_notequal(id, 0) |
80e69293217c
patch 8.2.3596: crash when using :pedit in Vim9 script
Bram Moolenaar <Bram@vim.org>
parents:
25949
diff
changeset
|
2015 assert_match('Xfile', popup_getoptions(id).title) |
80e69293217c
patch 8.2.3596: crash when using :pedit in Vim9 script
Bram Moolenaar <Bram@vim.org>
parents:
25949
diff
changeset
|
2016 popup_clear() |
80e69293217c
patch 8.2.3596: crash when using :pedit in Vim9 script
Bram Moolenaar <Bram@vim.org>
parents:
25949
diff
changeset
|
2017 set previewpopup& |
80e69293217c
patch 8.2.3596: crash when using :pedit in Vim9 script
Bram Moolenaar <Bram@vim.org>
parents:
25949
diff
changeset
|
2018 enddef |
80e69293217c
patch 8.2.3596: crash when using :pedit in Vim9 script
Bram Moolenaar <Bram@vim.org>
parents:
25949
diff
changeset
|
2019 |
26199
eaa97adb0732
patch 8.2.3631: "syntax enable" does not work properly in Vim9 context
Bram Moolenaar <Bram@vim.org>
parents:
26145
diff
changeset
|
2020 def Test_syntax_enable_clear() |
eaa97adb0732
patch 8.2.3631: "syntax enable" does not work properly in Vim9 context
Bram Moolenaar <Bram@vim.org>
parents:
26145
diff
changeset
|
2021 syntax clear |
eaa97adb0732
patch 8.2.3631: "syntax enable" does not work properly in Vim9 context
Bram Moolenaar <Bram@vim.org>
parents:
26145
diff
changeset
|
2022 syntax enable |
eaa97adb0732
patch 8.2.3631: "syntax enable" does not work properly in Vim9 context
Bram Moolenaar <Bram@vim.org>
parents:
26145
diff
changeset
|
2023 highlight clear String |
eaa97adb0732
patch 8.2.3631: "syntax enable" does not work properly in Vim9 context
Bram Moolenaar <Bram@vim.org>
parents:
26145
diff
changeset
|
2024 assert_equal(true, hlget('String')->get(0, {})->get('default', false)) |
eaa97adb0732
patch 8.2.3631: "syntax enable" does not work properly in Vim9 context
Bram Moolenaar <Bram@vim.org>
parents:
26145
diff
changeset
|
2025 syntax clear |
eaa97adb0732
patch 8.2.3631: "syntax enable" does not work properly in Vim9 context
Bram Moolenaar <Bram@vim.org>
parents:
26145
diff
changeset
|
2026 enddef |
eaa97adb0732
patch 8.2.3631: "syntax enable" does not work properly in Vim9 context
Bram Moolenaar <Bram@vim.org>
parents:
26145
diff
changeset
|
2027 |
24262
d0e86f1b34e7
patch 8.2.2672: Vim9: cannot use :lockvar and :unlockvar in compiled script
Bram Moolenaar <Bram@vim.org>
parents:
24222
diff
changeset
|
2028 |
20170
0612c64a2b87
patch 8.2.0640: Vim9: expanding does not work
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2029 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker |