annotate src/testdir/test_eval_stuff.vim @ 23768:1a53383f08e5 v8.2.2425

patch 8.2.2425: cursor on invalid line with range and :substitute Commit: https://github.com/vim/vim/commit/df2c2988bbaecd28b0fbec8d64327b1bbb005e19 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 28 20:18:08 2021 +0100 patch 8.2.2425: cursor on invalid line with range and :substitute Problem: Cursor on invalid line with range and :substitute. Solution: Do not move the cursor when skipping commands. (closes https://github.com/vim/vim/issues/3434)
author Bram Moolenaar <Bram@vim.org>
date Thu, 28 Jan 2021 20:30:03 +0100
parents cd06cc37f53f
children 82d2c859eb0c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13096
30f9a62f5f51 patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for various eval things.
30f9a62f5f51 patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
21267
7833afe1c66e patch 8.2.1184: some tests fail
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
3 source view_util.vim
7833afe1c66e patch 8.2.1184: some tests fail
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
4
13096
30f9a62f5f51 patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 function s:foo() abort
30f9a62f5f51 patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 try
30f9a62f5f51 patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 return [] == 0
30f9a62f5f51 patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 catch
30f9a62f5f51 patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 return 1
30f9a62f5f51 patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 endtry
30f9a62f5f51 patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 endfunction
30f9a62f5f51 patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12
30f9a62f5f51 patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 func Test_catch_return_with_error()
30f9a62f5f51 patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 call assert_equal(1, s:foo())
30f9a62f5f51 patch 8.0.1423: error in return not caught by try/catch
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 endfunc
13288
530943a23d3f patch 8.0.1518: error messages suppressed after ":silent! try"
Christian Brabandt <cb@256bit.org>
parents: 13096
diff changeset
16
530943a23d3f patch 8.0.1518: error messages suppressed after ":silent! try"
Christian Brabandt <cb@256bit.org>
parents: 13096
diff changeset
17 func Test_nocatch_restore_silent_emsg()
530943a23d3f patch 8.0.1518: error messages suppressed after ":silent! try"
Christian Brabandt <cb@256bit.org>
parents: 13096
diff changeset
18 silent! try
530943a23d3f patch 8.0.1518: error messages suppressed after ":silent! try"
Christian Brabandt <cb@256bit.org>
parents: 13096
diff changeset
19 throw 1
530943a23d3f patch 8.0.1518: error messages suppressed after ":silent! try"
Christian Brabandt <cb@256bit.org>
parents: 13096
diff changeset
20 catch
530943a23d3f patch 8.0.1518: error messages suppressed after ":silent! try"
Christian Brabandt <cb@256bit.org>
parents: 13096
diff changeset
21 endtry
21267
7833afe1c66e patch 8.2.1184: some tests fail
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
22 echoerr 'wrong again'
7833afe1c66e patch 8.2.1184: some tests fail
Bram Moolenaar <Bram@vim.org>
parents: 20743
diff changeset
23 call assert_equal('wrong again', ScreenLine(&lines))
13288
530943a23d3f patch 8.0.1518: error messages suppressed after ":silent! try"
Christian Brabandt <cb@256bit.org>
parents: 13096
diff changeset
24 endfunc
13672
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
25
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
26 func Test_mkdir_p()
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
27 call mkdir('Xmkdir/nested', 'p')
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
28 call assert_true(isdirectory('Xmkdir/nested'))
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
29 try
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
30 " Trying to make existing directories doesn't error
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
31 call mkdir('Xmkdir', 'p')
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
32 call mkdir('Xmkdir/nested', 'p')
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
33 catch /E739:/
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
34 call assert_report('mkdir(..., "p") failed for an existing directory')
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
35 endtry
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
36 " 'p' doesn't suppress real errors
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
37 call writefile([], 'Xfile')
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21949
diff changeset
38 call assert_fails('call mkdir("Xfile", "p")', 'E739:')
13672
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
39 call delete('Xfile')
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
40 call delete('Xmkdir', 'rf')
20158
94f05de75e9f patch 8.2.0634: crash with null partial and blob
Bram Moolenaar <Bram@vim.org>
parents: 20156
diff changeset
41 call assert_equal(0, mkdir(test_null_string()))
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21949
diff changeset
42 call assert_fails('call mkdir([])', 'E730:')
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 21949
diff changeset
43 call assert_fails('call mkdir("abc", [], [])', 'E745:')
13672
4a1efd1a6018 patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Christian Brabandt <cb@256bit.org>
parents: 13288
diff changeset
44 endfunc
14714
bdbb049c2aa8 patch 8.1.0369: continuation lines cannot contain comments
Christian Brabandt <cb@256bit.org>
parents: 13672
diff changeset
45
bdbb049c2aa8 patch 8.1.0369: continuation lines cannot contain comments
Christian Brabandt <cb@256bit.org>
parents: 13672
diff changeset
46 func Test_line_continuation()
bdbb049c2aa8 patch 8.1.0369: continuation lines cannot contain comments
Christian Brabandt <cb@256bit.org>
parents: 13672
diff changeset
47 let array = [5,
bdbb049c2aa8 patch 8.1.0369: continuation lines cannot contain comments
Christian Brabandt <cb@256bit.org>
parents: 13672
diff changeset
48 "\ ignore this
bdbb049c2aa8 patch 8.1.0369: continuation lines cannot contain comments
Christian Brabandt <cb@256bit.org>
parents: 13672
diff changeset
49 \ 6,
bdbb049c2aa8 patch 8.1.0369: continuation lines cannot contain comments
Christian Brabandt <cb@256bit.org>
parents: 13672
diff changeset
50 "\ more to ignore
bdbb049c2aa8 patch 8.1.0369: continuation lines cannot contain comments
Christian Brabandt <cb@256bit.org>
parents: 13672
diff changeset
51 "\ more moreto ignore
bdbb049c2aa8 patch 8.1.0369: continuation lines cannot contain comments
Christian Brabandt <cb@256bit.org>
parents: 13672
diff changeset
52 \ ]
bdbb049c2aa8 patch 8.1.0369: continuation lines cannot contain comments
Christian Brabandt <cb@256bit.org>
parents: 13672
diff changeset
53 "\ and some more
bdbb049c2aa8 patch 8.1.0369: continuation lines cannot contain comments
Christian Brabandt <cb@256bit.org>
parents: 13672
diff changeset
54 call assert_equal([5, 6], array)
bdbb049c2aa8 patch 8.1.0369: continuation lines cannot contain comments
Christian Brabandt <cb@256bit.org>
parents: 13672
diff changeset
55 endfunc
15107
6344377dc7dc patch 8.1.0564: setting v:errors to wrong type still possible
Bram Moolenaar <Bram@vim.org>
parents: 14714
diff changeset
56
6344377dc7dc patch 8.1.0564: setting v:errors to wrong type still possible
Bram Moolenaar <Bram@vim.org>
parents: 14714
diff changeset
57 func Test_E963()
6344377dc7dc patch 8.1.0564: setting v:errors to wrong type still possible
Bram Moolenaar <Bram@vim.org>
parents: 14714
diff changeset
58 " These commands used to cause an internal error prior to vim 8.1.0563
6344377dc7dc patch 8.1.0564: setting v:errors to wrong type still possible
Bram Moolenaar <Bram@vim.org>
parents: 14714
diff changeset
59 let v_e = v:errors
6344377dc7dc patch 8.1.0564: setting v:errors to wrong type still possible
Bram Moolenaar <Bram@vim.org>
parents: 14714
diff changeset
60 let v_o = v:oldfiles
6344377dc7dc patch 8.1.0564: setting v:errors to wrong type still possible
Bram Moolenaar <Bram@vim.org>
parents: 14714
diff changeset
61 call assert_fails("let v:errors=''", 'E963:')
6344377dc7dc patch 8.1.0564: setting v:errors to wrong type still possible
Bram Moolenaar <Bram@vim.org>
parents: 14714
diff changeset
62 call assert_equal(v_e, v:errors)
6344377dc7dc patch 8.1.0564: setting v:errors to wrong type still possible
Bram Moolenaar <Bram@vim.org>
parents: 14714
diff changeset
63 call assert_fails("let v:oldfiles=''", 'E963:')
6344377dc7dc patch 8.1.0564: setting v:errors to wrong type still possible
Bram Moolenaar <Bram@vim.org>
parents: 14714
diff changeset
64 call assert_equal(v_o, v:oldfiles)
6344377dc7dc patch 8.1.0564: setting v:errors to wrong type still possible
Bram Moolenaar <Bram@vim.org>
parents: 14714
diff changeset
65 endfunc
15456
f01eb1aed348 patch 8.1.0736: code for Blob not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15107
diff changeset
66
f01eb1aed348 patch 8.1.0736: code for Blob not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15107
diff changeset
67 func Test_for_invalid()
f01eb1aed348 patch 8.1.0736: code for Blob not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15107
diff changeset
68 call assert_fails("for x in 99", 'E714:')
f01eb1aed348 patch 8.1.0736: code for Blob not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15107
diff changeset
69 call assert_fails("for x in 'asdf'", 'E714:')
f01eb1aed348 patch 8.1.0736: code for Blob not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15107
diff changeset
70 call assert_fails("for x in {'a': 9}", 'E714:')
23768
1a53383f08e5 patch 8.2.2425: cursor on invalid line with range and :substitute
Bram Moolenaar <Bram@vim.org>
parents: 23693
diff changeset
71
1a53383f08e5 patch 8.2.2425: cursor on invalid line with range and :substitute
Bram Moolenaar <Bram@vim.org>
parents: 23693
diff changeset
72 if 0
1a53383f08e5 patch 8.2.2425: cursor on invalid line with range and :substitute
Bram Moolenaar <Bram@vim.org>
parents: 23693
diff changeset
73 /1/5/2/s/\n
1a53383f08e5 patch 8.2.2425: cursor on invalid line with range and :substitute
Bram Moolenaar <Bram@vim.org>
parents: 23693
diff changeset
74 endif
1a53383f08e5 patch 8.2.2425: cursor on invalid line with range and :substitute
Bram Moolenaar <Bram@vim.org>
parents: 23693
diff changeset
75 redraw
15456
f01eb1aed348 patch 8.1.0736: code for Blob not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 15107
diff changeset
76 endfunc
15468
1550cc188ff6 patch 8.1.0742: not all Blob operations are tested
Bram Moolenaar <Bram@vim.org>
parents: 15456
diff changeset
77
1550cc188ff6 patch 8.1.0742: not all Blob operations are tested
Bram Moolenaar <Bram@vim.org>
parents: 15456
diff changeset
78 func Test_readfile_binary()
1550cc188ff6 patch 8.1.0742: not all Blob operations are tested
Bram Moolenaar <Bram@vim.org>
parents: 15456
diff changeset
79 new
1550cc188ff6 patch 8.1.0742: not all Blob operations are tested
Bram Moolenaar <Bram@vim.org>
parents: 15456
diff changeset
80 call setline(1, ['one', 'two', 'three'])
1550cc188ff6 patch 8.1.0742: not all Blob operations are tested
Bram Moolenaar <Bram@vim.org>
parents: 15456
diff changeset
81 setlocal ff=dos
21911
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
82 silent write XReadfile_bin
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
83 let lines = 'XReadfile_bin'->readfile()
15468
1550cc188ff6 patch 8.1.0742: not all Blob operations are tested
Bram Moolenaar <Bram@vim.org>
parents: 15456
diff changeset
84 call assert_equal(['one', 'two', 'three'], lines)
21911
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
85 let lines = readfile('XReadfile_bin', '', 2)
15468
1550cc188ff6 patch 8.1.0742: not all Blob operations are tested
Bram Moolenaar <Bram@vim.org>
parents: 15456
diff changeset
86 call assert_equal(['one', 'two'], lines)
21911
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
87 let lines = readfile('XReadfile_bin', 'b')
15468
1550cc188ff6 patch 8.1.0742: not all Blob operations are tested
Bram Moolenaar <Bram@vim.org>
parents: 15456
diff changeset
88 call assert_equal(["one\r", "two\r", "three\r", ""], lines)
21911
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
89 let lines = readfile('XReadfile_bin', 'b', 2)
15468
1550cc188ff6 patch 8.1.0742: not all Blob operations are tested
Bram Moolenaar <Bram@vim.org>
parents: 15456
diff changeset
90 call assert_equal(["one\r", "two\r"], lines)
1550cc188ff6 patch 8.1.0742: not all Blob operations are tested
Bram Moolenaar <Bram@vim.org>
parents: 15456
diff changeset
91
1550cc188ff6 patch 8.1.0742: not all Blob operations are tested
Bram Moolenaar <Bram@vim.org>
parents: 15456
diff changeset
92 bwipe!
21911
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
93 call delete('XReadfile_bin')
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
94 endfunc
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
95
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
96 func Test_readfile_bom()
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
97 call writefile(["\ufeffFOO", "FOO\ufeffBAR"], 'XReadfile_bom')
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
98 call assert_equal(['FOO', 'FOOBAR'], readfile('XReadfile_bom'))
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
99 call delete('XReadfile_bom')
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
100 endfunc
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
101
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
102 func Test_readfile_max()
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
103 call writefile(range(1, 4), 'XReadfile_max')
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
104 call assert_equal(['1', '2'], readfile('XReadfile_max', '', 2))
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
105 call assert_equal(['3', '4'], readfile('XReadfile_max', '', -2))
0c0e8cd8c177 patch 8.2.1505: not all file read and writecode is tested
Bram Moolenaar <Bram@vim.org>
parents: 21658
diff changeset
106 call delete('XReadfile_max')
15468
1550cc188ff6 patch 8.1.0742: not all Blob operations are tested
Bram Moolenaar <Bram@vim.org>
parents: 15456
diff changeset
107 endfunc
15593
e26caeb30026 patch 8.1.0804: crash when setting v:errmsg to empty list
Bram Moolenaar <Bram@vim.org>
parents: 15468
diff changeset
108
e26caeb30026 patch 8.1.0804: crash when setting v:errmsg to empty list
Bram Moolenaar <Bram@vim.org>
parents: 15468
diff changeset
109 func Test_let_errmsg()
e26caeb30026 patch 8.1.0804: crash when setting v:errmsg to empty list
Bram Moolenaar <Bram@vim.org>
parents: 15468
diff changeset
110 call assert_fails('let v:errmsg = []', 'E730:')
e26caeb30026 patch 8.1.0804: crash when setting v:errmsg to empty list
Bram Moolenaar <Bram@vim.org>
parents: 15468
diff changeset
111 let v:errmsg = ''
e26caeb30026 patch 8.1.0804: crash when setting v:errmsg to empty list
Bram Moolenaar <Bram@vim.org>
parents: 15468
diff changeset
112 call assert_fails('let v:errmsg = []', 'E730:')
e26caeb30026 patch 8.1.0804: crash when setting v:errmsg to empty list
Bram Moolenaar <Bram@vim.org>
parents: 15468
diff changeset
113 let v:errmsg = ''
e26caeb30026 patch 8.1.0804: crash when setting v:errmsg to empty list
Bram Moolenaar <Bram@vim.org>
parents: 15468
diff changeset
114 endfunc
16219
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
115
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
116 func Test_string_concatenation()
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
117 call assert_equal('ab', 'a'.'b')
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
118 call assert_equal('ab', 'a' .'b')
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
119 call assert_equal('ab', 'a'. 'b')
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
120 call assert_equal('ab', 'a' . 'b')
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
121
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
122 call assert_equal('ab', 'a'..'b')
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
123 call assert_equal('ab', 'a' ..'b')
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
124 call assert_equal('ab', 'a'.. 'b')
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
125 call assert_equal('ab', 'a' .. 'b')
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
126
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
127 let a = 'a'
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
128 let b = 'b'
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
129 let a .= b
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
130 call assert_equal('ab', a)
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
131
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
132 let a = 'a'
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
133 let a.=b
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
134 call assert_equal('ab', a)
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
135
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
136 let a = 'a'
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
137 let a ..= b
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
138 call assert_equal('ab', a)
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
139
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
140 let a = 'a'
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
141 let a..=b
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
142 call assert_equal('ab', a)
21949
e6608764248a patch 8.2.1524: no longer get an error for string concatenation with float
Bram Moolenaar <Bram@vim.org>
parents: 21911
diff changeset
143
e6608764248a patch 8.2.1524: no longer get an error for string concatenation with float
Bram Moolenaar <Bram@vim.org>
parents: 21911
diff changeset
144 if has('float')
e6608764248a patch 8.2.1524: no longer get an error for string concatenation with float
Bram Moolenaar <Bram@vim.org>
parents: 21911
diff changeset
145 let a = 'A'
e6608764248a patch 8.2.1524: no longer get an error for string concatenation with float
Bram Moolenaar <Bram@vim.org>
parents: 21911
diff changeset
146 let b = 1.234
e6608764248a patch 8.2.1524: no longer get an error for string concatenation with float
Bram Moolenaar <Bram@vim.org>
parents: 21911
diff changeset
147 call assert_fails('echo a .. b', 'E806:')
e6608764248a patch 8.2.1524: no longer get an error for string concatenation with float
Bram Moolenaar <Bram@vim.org>
parents: 21911
diff changeset
148 endif
16219
bd49e1656c72 patch 8.1.1114: confusing overloaded operator "." for string concatenation
Bram Moolenaar <Bram@vim.org>
parents: 15593
diff changeset
149 endfunc
16223
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
150
18080
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
151 " Test fix for issue #4507
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
152 func Test_skip_after_throw()
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
153 try
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
154 throw 'something'
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
155 let x = wincol() || &ts
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
156 catch /something/
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
157 endtry
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
158 endfunc
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
159
16223
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
160 scriptversion 2
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
161 func Test_string_concat_scriptversion2()
16370
235a2b941498 patch 8.1.1190: has('vimscript-3') does not work
Bram Moolenaar <Bram@vim.org>
parents: 16366
diff changeset
162 call assert_true(has('vimscript-2'))
16223
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
163 let a = 'a'
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
164 let b = 'b'
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
165
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
166 call assert_fails('echo a . b', 'E15:')
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
167 call assert_fails('let a .= b', 'E985:')
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
168 call assert_fails('let vers = 1.2.3', 'E15:')
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
169
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
170 if has('float')
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
171 let f = .5
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
172 call assert_equal(0.5, f)
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
173 endif
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
174 endfunc
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
175
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
176 scriptversion 1
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
177 func Test_string_concat_scriptversion1()
16370
235a2b941498 patch 8.1.1190: has('vimscript-3') does not work
Bram Moolenaar <Bram@vim.org>
parents: 16366
diff changeset
178 call assert_true(has('vimscript-1'))
16223
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
179 let a = 'a'
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
180 let b = 'b'
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
181
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
182 echo a . b
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
183 let a .= b
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
184 let vers = 1.2.3
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
185 call assert_equal('123', vers)
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
186
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
187 if has('float')
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
188 call assert_fails('let f = .5', 'E15:')
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
189 endif
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
190 endfunc
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
191
16366
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
192 scriptversion 3
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
193 func Test_vvar_scriptversion3()
16370
235a2b941498 patch 8.1.1190: has('vimscript-3') does not work
Bram Moolenaar <Bram@vim.org>
parents: 16366
diff changeset
194 call assert_true(has('vimscript-3'))
16366
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
195 call assert_fails('echo version', 'E121:')
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
196 call assert_false(exists('version'))
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
197 let version = 1
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
198 call assert_equal(1, version)
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
199 endfunc
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
200
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
201 scriptversion 2
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
202 func Test_vvar_scriptversion2()
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
203 call assert_true(exists('version'))
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
204 echo version
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
205 call assert_fails('let version = 1', 'E46:')
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
206 call assert_equal(v:version, version)
17053
d5fa04016df0 patch 8.1.1526: no numerical value for the patchlevel
Bram Moolenaar <Bram@vim.org>
parents: 16982
diff changeset
207
d5fa04016df0 patch 8.1.1526: no numerical value for the patchlevel
Bram Moolenaar <Bram@vim.org>
parents: 16982
diff changeset
208 call assert_equal(v:version, v:versionlong / 10000)
d5fa04016df0 patch 8.1.1526: no numerical value for the patchlevel
Bram Moolenaar <Bram@vim.org>
parents: 16982
diff changeset
209 call assert_true(v:versionlong > 8011525)
16366
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
210 endfunc
6ee80f3b5ea9 patch 8.1.1188: not all Vim variables require the v: prefix
Bram Moolenaar <Bram@vim.org>
parents: 16223
diff changeset
211
17448
f8cd16838434 patch 8.1.1722: error when scriptversion is 2 a making a dictionary access
Bram Moolenaar <Bram@vim.org>
parents: 17053
diff changeset
212 func Test_dict_access_scriptversion2()
f8cd16838434 patch 8.1.1722: error when scriptversion is 2 a making a dictionary access
Bram Moolenaar <Bram@vim.org>
parents: 17053
diff changeset
213 let l:x = {'foo': 1}
f8cd16838434 patch 8.1.1722: error when scriptversion is 2 a making a dictionary access
Bram Moolenaar <Bram@vim.org>
parents: 17053
diff changeset
214
f8cd16838434 patch 8.1.1722: error when scriptversion is 2 a making a dictionary access
Bram Moolenaar <Bram@vim.org>
parents: 17053
diff changeset
215 call assert_false(0 && l:x.foo)
f8cd16838434 patch 8.1.1722: error when scriptversion is 2 a making a dictionary access
Bram Moolenaar <Bram@vim.org>
parents: 17053
diff changeset
216 call assert_true(1 && l:x.foo)
f8cd16838434 patch 8.1.1722: error when scriptversion is 2 a making a dictionary access
Bram Moolenaar <Bram@vim.org>
parents: 17053
diff changeset
217 endfunc
f8cd16838434 patch 8.1.1722: error when scriptversion is 2 a making a dictionary access
Bram Moolenaar <Bram@vim.org>
parents: 17053
diff changeset
218
18080
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
219 scriptversion 4
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
220 func Test_vvar_scriptversion4()
18086
9d6832a5426f patch 8.1.2038: has('vimscript-4') is always 0
Bram Moolenaar <Bram@vim.org>
parents: 18080
diff changeset
221 call assert_true(has('vimscript-4'))
18080
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
222 call assert_equal(17, 017)
20665
6ff992bf4c82 patch 8.2.0886: cannot use octal numbers in scriptversion 4
Bram Moolenaar <Bram@vim.org>
parents: 20211
diff changeset
223 call assert_equal(15, 0o17)
6ff992bf4c82 patch 8.2.0886: cannot use octal numbers in scriptversion 4
Bram Moolenaar <Bram@vim.org>
parents: 20211
diff changeset
224 call assert_equal(15, 0O17)
18080
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
225 call assert_equal(18, 018)
23533
ee43d943c3bb patch 8.2.2309: 0o777 not recognized as octal
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
226 call assert_equal(511, 0o777)
18080
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
227 call assert_equal(64, 0b1'00'00'00)
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
228 call assert_equal(1048576, 0x10'00'00)
20665
6ff992bf4c82 patch 8.2.0886: cannot use octal numbers in scriptversion 4
Bram Moolenaar <Bram@vim.org>
parents: 20211
diff changeset
229 call assert_equal(32768, 0o10'00'00)
18080
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
230 call assert_equal(1000000, 1'000'000)
18096
609b351cb58f patch 8.1.2043: not sufficient testing for quoted numbers
Bram Moolenaar <Bram@vim.org>
parents: 18086
diff changeset
231 call assert_equal("1234", execute("echo 1'234")->trim())
609b351cb58f patch 8.1.2043: not sufficient testing for quoted numbers
Bram Moolenaar <Bram@vim.org>
parents: 18086
diff changeset
232 call assert_equal('1 234', execute("echo 1''234")->trim())
609b351cb58f patch 8.1.2043: not sufficient testing for quoted numbers
Bram Moolenaar <Bram@vim.org>
parents: 18086
diff changeset
233 call assert_fails("echo 1'''234", 'E115:')
18080
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
234 endfunc
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
235
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
236 scriptversion 1
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
237 func Test_vvar_scriptversion1()
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
238 call assert_equal(15, 017)
20665
6ff992bf4c82 patch 8.2.0886: cannot use octal numbers in scriptversion 4
Bram Moolenaar <Bram@vim.org>
parents: 20211
diff changeset
239 call assert_equal(15, 0o17)
6ff992bf4c82 patch 8.2.0886: cannot use octal numbers in scriptversion 4
Bram Moolenaar <Bram@vim.org>
parents: 20211
diff changeset
240 call assert_equal(15, 0O17)
18080
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
241 call assert_equal(18, 018)
23533
ee43d943c3bb patch 8.2.2309: 0o777 not recognized as octal
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
242 call assert_equal(511, 0o777)
18080
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
243 endfunc
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
244
a6d218f99ff7 patch 8.1.2035: recognizing octal numbers is confusing
Bram Moolenaar <Bram@vim.org>
parents: 17982
diff changeset
245 func Test_scriptversion_fail()
16223
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
246 call writefile(['scriptversion 9'], 'Xversionscript')
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
247 call assert_fails('source Xversionscript', 'E999:')
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
248 call delete('Xversionscript')
abb67309c1ca patch 8.1.1116: cannot enforce a Vim script style
Bram Moolenaar <Bram@vim.org>
parents: 16219
diff changeset
249 endfunc
19087
e3848b251a01 patch 8.2.0104: using channel or job with ":execute" has strange effects
Bram Moolenaar <Bram@vim.org>
parents: 18096
diff changeset
250
20156
49694eceaa55 patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents: 20109
diff changeset
251 func Test_execute_cmd_with_null()
19087
e3848b251a01 patch 8.2.0104: using channel or job with ":execute" has strange effects
Bram Moolenaar <Bram@vim.org>
parents: 18096
diff changeset
252 call assert_fails('execute test_null_list()', 'E730:')
e3848b251a01 patch 8.2.0104: using channel or job with ":execute" has strange effects
Bram Moolenaar <Bram@vim.org>
parents: 18096
diff changeset
253 call assert_fails('execute test_null_dict()', 'E731:')
e3848b251a01 patch 8.2.0104: using channel or job with ":execute" has strange effects
Bram Moolenaar <Bram@vim.org>
parents: 18096
diff changeset
254 call assert_fails('execute test_null_blob()', 'E976:')
e3848b251a01 patch 8.2.0104: using channel or job with ":execute" has strange effects
Bram Moolenaar <Bram@vim.org>
parents: 18096
diff changeset
255 execute test_null_string()
e3848b251a01 patch 8.2.0104: using channel or job with ":execute" has strange effects
Bram Moolenaar <Bram@vim.org>
parents: 18096
diff changeset
256 call assert_fails('execute test_null_partial()', 'E729:')
20158
94f05de75e9f patch 8.2.0634: crash with null partial and blob
Bram Moolenaar <Bram@vim.org>
parents: 20156
diff changeset
257 call assert_fails('execute test_unknown()', 'E908:')
19087
e3848b251a01 patch 8.2.0104: using channel or job with ":execute" has strange effects
Bram Moolenaar <Bram@vim.org>
parents: 18096
diff changeset
258 if has('job')
e3848b251a01 patch 8.2.0104: using channel or job with ":execute" has strange effects
Bram Moolenaar <Bram@vim.org>
parents: 18096
diff changeset
259 call assert_fails('execute test_null_job()', 'E908:')
e3848b251a01 patch 8.2.0104: using channel or job with ":execute" has strange effects
Bram Moolenaar <Bram@vim.org>
parents: 18096
diff changeset
260 call assert_fails('execute test_null_channel()', 'E908:')
e3848b251a01 patch 8.2.0104: using channel or job with ":execute" has strange effects
Bram Moolenaar <Bram@vim.org>
parents: 18096
diff changeset
261 endif
e3848b251a01 patch 8.2.0104: using channel or job with ":execute" has strange effects
Bram Moolenaar <Bram@vim.org>
parents: 18096
diff changeset
262 endfunc
19477
2bb0e80fcd32 patch 8.2.0296: mixing up "long long" and __int64 may cause problems
Bram Moolenaar <Bram@vim.org>
parents: 19087
diff changeset
263
23693
cd06cc37f53f patch 8.2.2388: no easy way to get the maximum or mininum number value
Bram Moolenaar <Bram@vim.org>
parents: 23533
diff changeset
264 func Test_number_max_min_size()
cd06cc37f53f patch 8.2.2388: no easy way to get the maximum or mininum number value
Bram Moolenaar <Bram@vim.org>
parents: 23533
diff changeset
265 " This will fail on systems without 64 bit number support or when not
cd06cc37f53f patch 8.2.2388: no easy way to get the maximum or mininum number value
Bram Moolenaar <Bram@vim.org>
parents: 23533
diff changeset
266 " configured correctly.
19477
2bb0e80fcd32 patch 8.2.0296: mixing up "long long" and __int64 may cause problems
Bram Moolenaar <Bram@vim.org>
parents: 19087
diff changeset
267 call assert_equal(64, v:numbersize)
23693
cd06cc37f53f patch 8.2.2388: no easy way to get the maximum or mininum number value
Bram Moolenaar <Bram@vim.org>
parents: 23533
diff changeset
268
cd06cc37f53f patch 8.2.2388: no easy way to get the maximum or mininum number value
Bram Moolenaar <Bram@vim.org>
parents: 23533
diff changeset
269 call assert_true(v:numbermin < -9999999)
cd06cc37f53f patch 8.2.2388: no easy way to get the maximum or mininum number value
Bram Moolenaar <Bram@vim.org>
parents: 23533
diff changeset
270 call assert_true(v:numbermax > 9999999)
19477
2bb0e80fcd32 patch 8.2.0296: mixing up "long long" and __int64 may cause problems
Bram Moolenaar <Bram@vim.org>
parents: 19087
diff changeset
271 endfunc
19724
b3e93a05c3ca patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19477
diff changeset
272
20083
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
273 func Assert_reg(name, type, value, valuestr, expr, exprstr)
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
274 call assert_equal(a:type, getregtype(a:name))
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
275 call assert_equal(a:value, getreg(a:name))
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
276 call assert_equal(a:valuestr, string(getreg(a:name, 0, 1)))
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
277 call assert_equal(a:expr, getreg(a:name, 1))
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
278 call assert_equal(a:exprstr, string(getreg(a:name, 1, 1)))
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
279 endfunc
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
280
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
281 func Test_let_register()
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
282 let @" = 'abc'
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
283 call Assert_reg('"', 'v', "abc", "['abc']", "abc", "['abc']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
284 let @" = "abc\n"
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
285 call Assert_reg('"', 'V', "abc\n", "['abc']", "abc\n", "['abc']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
286 let @" = "abc\<C-m>"
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
287 call Assert_reg('"', 'V', "abc\r\n", "['abc\r']", "abc\r\n", "['abc\r']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
288 let @= = '"abc"'
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
289 call Assert_reg('=', 'v', "abc", "['abc']", '"abc"', "['\"abc\"']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
290 endfunc
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
291
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
292 func Assert_regput(name, result)
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
293 new
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
294 execute "silent normal! o==\n==\e\"" . a:name . "P"
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
295 call assert_equal(a:result, getline(2, line('$')))
20085
f5274405ae64 patch 8.2.0598: test_eval_stuff fails in normal terminal
Bram Moolenaar <Bram@vim.org>
parents: 20083
diff changeset
296 bwipe!
20083
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
297 endfunc
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
298
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
299 func Test_setreg_basic()
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
300 call setreg('a', 'abcA', 'c')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
301 call Assert_reg('a', 'v', "abcA", "['abcA']", "abcA", "['abcA']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
302 call Assert_regput('a', ['==', '=abcA='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
303
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
304 call setreg('A', 'abcAc', 'c')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
305 call Assert_reg('A', 'v', "abcAabcAc", "['abcAabcAc']", "abcAabcAc", "['abcAabcAc']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
306 call Assert_regput('a', ['==', '=abcAabcAc='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
307
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
308 call setreg('A', 'abcAl', 'l')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
309 call Assert_reg('A', 'V', "abcAabcAcabcAl\n", "['abcAabcAcabcAl']", "abcAabcAcabcAl\n", "['abcAabcAcabcAl']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
310 call Assert_regput('a', ['==', 'abcAabcAcabcAl', '=='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
311
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
312 call setreg('A', 'abcAc2','c')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
313 call Assert_reg('A', 'v', "abcAabcAcabcAl\nabcAc2", "['abcAabcAcabcAl', 'abcAc2']", "abcAabcAcabcAl\nabcAc2", "['abcAabcAcabcAl', 'abcAc2']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
314 call Assert_regput('a', ['==', '=abcAabcAcabcAl', 'abcAc2='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
315
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
316 call setreg('b', 'abcB', 'v')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
317 call Assert_reg('b', 'v', "abcB", "['abcB']", "abcB", "['abcB']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
318 call Assert_regput('b', ['==', '=abcB='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
319
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
320 call setreg('b', 'abcBc', 'ca')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
321 call Assert_reg('b', 'v', "abcBabcBc", "['abcBabcBc']", "abcBabcBc", "['abcBabcBc']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
322 call Assert_regput('b', ['==', '=abcBabcBc='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
323
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
324 call setreg('b', 'abcBb', 'ba')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
325 call Assert_reg('b', "\<C-V>5", "abcBabcBcabcBb", "['abcBabcBcabcBb']", "abcBabcBcabcBb", "['abcBabcBcabcBb']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
326 call Assert_regput('b', ['==', '=abcBabcBcabcBb='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
327
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
328 call setreg('b', 'abcBc2','ca')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
329 call Assert_reg('b', "v", "abcBabcBcabcBb\nabcBc2", "['abcBabcBcabcBb', 'abcBc2']", "abcBabcBcabcBb\nabcBc2", "['abcBabcBcabcBb', 'abcBc2']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
330 call Assert_regput('b', ['==', '=abcBabcBcabcBb', 'abcBc2='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
331
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
332 call setreg('b', 'abcBb2','b50a')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
333 call Assert_reg('b', "\<C-V>50", "abcBabcBcabcBb\nabcBc2abcBb2", "['abcBabcBcabcBb', 'abcBc2abcBb2']", "abcBabcBcabcBb\nabcBc2abcBb2", "['abcBabcBcabcBb', 'abcBc2abcBb2']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
334 call Assert_regput('b', ['==', '=abcBabcBcabcBb =', ' abcBc2abcBb2'])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
335
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
336 call setreg('c', 'abcC', 'l')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
337 call Assert_reg('c', 'V', "abcC\n", "['abcC']", "abcC\n", "['abcC']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
338 call Assert_regput('c', ['==', 'abcC', '=='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
339
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
340 call setreg('C', 'abcCl', 'l')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
341 call Assert_reg('C', 'V', "abcC\nabcCl\n", "['abcC', 'abcCl']", "abcC\nabcCl\n", "['abcC', 'abcCl']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
342 call Assert_regput('c', ['==', 'abcC', 'abcCl', '=='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
343
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
344 call setreg('C', 'abcCc', 'c')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
345 call Assert_reg('C', 'v', "abcC\nabcCl\nabcCc", "['abcC', 'abcCl', 'abcCc']", "abcC\nabcCl\nabcCc", "['abcC', 'abcCl', 'abcCc']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
346 call Assert_regput('c', ['==', '=abcC', 'abcCl', 'abcCc='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
347
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
348 call setreg('d', 'abcD', 'V')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
349 call Assert_reg('d', 'V', "abcD\n", "['abcD']", "abcD\n", "['abcD']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
350 call Assert_regput('d', ['==', 'abcD', '=='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
351
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
352 call setreg('D', 'abcDb', 'b')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
353 call Assert_reg('d', "\<C-V>5", "abcD\nabcDb", "['abcD', 'abcDb']", "abcD\nabcDb", "['abcD', 'abcDb']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
354 call Assert_regput('d', ['==', '=abcD =', ' abcDb'])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
355
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
356 call setreg('e', 'abcE', 'b')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
357 call Assert_reg('e', "\<C-V>4", "abcE", "['abcE']", "abcE", "['abcE']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
358 call Assert_regput('e', ['==', '=abcE='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
359
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
360 call setreg('E', 'abcEb', 'b')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
361 call Assert_reg('E', "\<C-V>5", "abcE\nabcEb", "['abcE', 'abcEb']", "abcE\nabcEb", "['abcE', 'abcEb']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
362 call Assert_regput('e', ['==', '=abcE =', ' abcEb'])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
363
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
364 call setreg('E', 'abcEl', 'l')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
365 call Assert_reg('E', "V", "abcE\nabcEb\nabcEl\n", "['abcE', 'abcEb', 'abcEl']", "abcE\nabcEb\nabcEl\n", "['abcE', 'abcEb', 'abcEl']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
366 call Assert_regput('e', ['==', 'abcE', 'abcEb', 'abcEl', '=='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
367
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
368 call setreg('f', 'abcF', "\<C-v>")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
369 call Assert_reg('f', "\<C-V>4", "abcF", "['abcF']", "abcF", "['abcF']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
370 call Assert_regput('f', ['==', '=abcF='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
371
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
372 call setreg('F', 'abcFc', 'c')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
373 call Assert_reg('F', "v", "abcF\nabcFc", "['abcF', 'abcFc']", "abcF\nabcFc", "['abcF', 'abcFc']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
374 call Assert_regput('f', ['==', '=abcF', 'abcFc='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
375
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
376 call setreg('g', 'abcG', 'b10')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
377 call Assert_reg('g', "\<C-V>10", "abcG", "['abcG']", "abcG", "['abcG']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
378 call Assert_regput('g', ['==', '=abcG ='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
379
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
380 call setreg('h', 'abcH', "\<C-v>10")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
381 call Assert_reg('h', "\<C-V>10", "abcH", "['abcH']", "abcH", "['abcH']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
382 call Assert_regput('h', ['==', '=abcH ='])
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
383
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
384 call setreg('I', 'abcI')
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
385 call Assert_reg('I', "v", "abcI", "['abcI']", "abcI", "['abcI']")
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
386 call Assert_regput('I', ['==', '=abcI='])
20109
e82996ad131f patch 8.2.0610: some tests are still old style
Bram Moolenaar <Bram@vim.org>
parents: 20085
diff changeset
387
20211
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
388 " Appending NL with setreg()
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
389 call setreg('a', 'abcA2', 'c')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
390 call setreg('b', 'abcB2', 'v')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
391 call setreg('c', 'abcC2', 'l')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
392 call setreg('d', 'abcD2', 'V')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
393 call setreg('e', 'abcE2', 'b')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
394 call setreg('f', 'abcF2', "\<C-v>")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
395 call setreg('g', 'abcG2', 'b10')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
396 call setreg('h', 'abcH2', "\<C-v>10")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
397 call setreg('I', 'abcI2')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
398
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
399 call setreg('A', "\n")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
400 call Assert_reg('A', 'V', "abcA2\n", "['abcA2']", "abcA2\n", "['abcA2']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
401 call Assert_regput('A', ['==', 'abcA2', '=='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
402
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
403 call setreg('B', "\n", 'c')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
404 call Assert_reg('B', 'v', "abcB2\n", "['abcB2', '']", "abcB2\n", "['abcB2', '']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
405 call Assert_regput('B', ['==', '=abcB2', '='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
406
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
407 call setreg('C', "\n")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
408 call Assert_reg('C', 'V', "abcC2\n\n", "['abcC2', '']", "abcC2\n\n", "['abcC2', '']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
409 call Assert_regput('C', ['==', 'abcC2', '', '=='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
410
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
411 call setreg('D', "\n", 'l')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
412 call Assert_reg('D', 'V', "abcD2\n\n", "['abcD2', '']", "abcD2\n\n", "['abcD2', '']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
413 call Assert_regput('D', ['==', 'abcD2', '', '=='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
414
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
415 call setreg('E', "\n")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
416 call Assert_reg('E', 'V', "abcE2\n\n", "['abcE2', '']", "abcE2\n\n", "['abcE2', '']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
417 call Assert_regput('E', ['==', 'abcE2', '', '=='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
418
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
419 call setreg('F', "\n", 'b')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
420 call Assert_reg('F', "\<C-V>0", "abcF2\n", "['abcF2', '']", "abcF2\n", "['abcF2', '']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
421 call Assert_regput('F', ['==', '=abcF2=', ' '])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
422
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
423 " Setting lists with setreg()
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
424 call setreg('a', ['abcA3'], 'c')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
425 call Assert_reg('a', 'v', "abcA3", "['abcA3']", "abcA3", "['abcA3']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
426 call Assert_regput('a', ['==', '=abcA3='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
427
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
428 call setreg('b', ['abcB3'], 'l')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
429 call Assert_reg('b', 'V', "abcB3\n", "['abcB3']", "abcB3\n", "['abcB3']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
430 call Assert_regput('b', ['==', 'abcB3', '=='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
431
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
432 call setreg('c', ['abcC3'], 'b')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
433 call Assert_reg('c', "\<C-V>5", "abcC3", "['abcC3']", "abcC3", "['abcC3']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
434 call Assert_regput('c', ['==', '=abcC3='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
435
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
436 call setreg('d', ['abcD3'])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
437 call Assert_reg('d', 'V', "abcD3\n", "['abcD3']", "abcD3\n", "['abcD3']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
438 call Assert_regput('d', ['==', 'abcD3', '=='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
439
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
440 call setreg('e', [1, 2, 'abc', 3])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
441 call Assert_reg('e', 'V', "1\n2\nabc\n3\n", "['1', '2', 'abc', '3']", "1\n2\nabc\n3\n", "['1', '2', 'abc', '3']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
442 call Assert_regput('e', ['==', '1', '2', 'abc', '3', '=='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
443
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
444 call setreg('f', [1, 2, 3])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
445 call Assert_reg('f', 'V', "1\n2\n3\n", "['1', '2', '3']", "1\n2\n3\n", "['1', '2', '3']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
446 call Assert_regput('f', ['==', '1', '2', '3', '=='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
447
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
448 " Appending lists with setreg()
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
449 call setreg('A', ['abcA3c'], 'c')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
450 call Assert_reg('A', 'v', "abcA3\nabcA3c", "['abcA3', 'abcA3c']", "abcA3\nabcA3c", "['abcA3', 'abcA3c']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
451 call Assert_regput('A', ['==', '=abcA3', 'abcA3c='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
452
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
453 call setreg('b', ['abcB3l'], 'la')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
454 call Assert_reg('b', 'V', "abcB3\nabcB3l\n", "['abcB3', 'abcB3l']", "abcB3\nabcB3l\n", "['abcB3', 'abcB3l']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
455 call Assert_regput('b', ['==', 'abcB3', 'abcB3l', '=='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
456
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
457 call setreg('C', ['abcC3b'], 'lb')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
458 call Assert_reg('C', "\<C-V>6", "abcC3\nabcC3b", "['abcC3', 'abcC3b']", "abcC3\nabcC3b", "['abcC3', 'abcC3b']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
459 call Assert_regput('C', ['==', '=abcC3 =', ' abcC3b'])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
460
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
461 call setreg('D', ['abcD32'])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
462 call Assert_reg('D', 'V', "abcD3\nabcD32\n", "['abcD3', 'abcD32']", "abcD3\nabcD32\n", "['abcD3', 'abcD32']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
463 call Assert_regput('D', ['==', 'abcD3', 'abcD32', '=='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
464
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
465 call setreg('A', ['abcA32'])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
466 call Assert_reg('A', 'V', "abcA3\nabcA3c\nabcA32\n", "['abcA3', 'abcA3c', 'abcA32']", "abcA3\nabcA3c\nabcA32\n", "['abcA3', 'abcA3c', 'abcA32']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
467 call Assert_regput('A', ['==', 'abcA3', 'abcA3c', 'abcA32', '=='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
468
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
469 call setreg('B', ['abcB3c'], 'c')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
470 call Assert_reg('B', 'v', "abcB3\nabcB3l\nabcB3c", "['abcB3', 'abcB3l', 'abcB3c']", "abcB3\nabcB3l\nabcB3c", "['abcB3', 'abcB3l', 'abcB3c']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
471 call Assert_regput('B', ['==', '=abcB3', 'abcB3l', 'abcB3c='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
472
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
473 call setreg('C', ['abcC3l'], 'l')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
474 call Assert_reg('C', 'V', "abcC3\nabcC3b\nabcC3l\n", "['abcC3', 'abcC3b', 'abcC3l']", "abcC3\nabcC3b\nabcC3l\n", "['abcC3', 'abcC3b', 'abcC3l']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
475 call Assert_regput('C', ['==', 'abcC3', 'abcC3b', 'abcC3l', '=='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
476
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
477 call setreg('D', ['abcD3b'], 'b')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
478 call Assert_reg('D', "\<C-V>6", "abcD3\nabcD32\nabcD3b", "['abcD3', 'abcD32', 'abcD3b']", "abcD3\nabcD32\nabcD3b", "['abcD3', 'abcD32', 'abcD3b']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
479 call Assert_regput('D', ['==', '=abcD3 =', ' abcD32', ' abcD3b'])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
480
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
481 " Appending lists with NL with setreg()
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
482 call setreg('A', ["\n", 'abcA3l2'], 'l')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
483 call Assert_reg('A', "V", "abcA3\nabcA3c\nabcA32\n\n\nabcA3l2\n", "['abcA3', 'abcA3c', 'abcA32', '\n', 'abcA3l2']", "abcA3\nabcA3c\nabcA32\n\n\nabcA3l2\n", "['abcA3', 'abcA3c', 'abcA32', '\n', 'abcA3l2']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
484 call Assert_regput('A', ['==', 'abcA3', 'abcA3c', 'abcA32', "\n", 'abcA3l2', '=='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
485
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
486 call setreg('B', ["\n", 'abcB3c2'], 'c')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
487 call Assert_reg('B', "v", "abcB3\nabcB3l\nabcB3c\n\n\nabcB3c2", "['abcB3', 'abcB3l', 'abcB3c', '\n', 'abcB3c2']", "abcB3\nabcB3l\nabcB3c\n\n\nabcB3c2", "['abcB3', 'abcB3l', 'abcB3c', '\n', 'abcB3c2']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
488 call Assert_regput('B', ['==', '=abcB3', 'abcB3l', 'abcB3c', "\n", 'abcB3c2='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
489
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
490 call setreg('C', ["\n", 'abcC3b2'], 'b')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
491 call Assert_reg('C', "7", "abcC3\nabcC3b\nabcC3l\n\n\nabcC3b2", "['abcC3', 'abcC3b', 'abcC3l', '\n', 'abcC3b2']", "abcC3\nabcC3b\nabcC3l\n\n\nabcC3b2", "['abcC3', 'abcC3b', 'abcC3l', '\n', 'abcC3b2']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
492 call Assert_regput('C', ['==', '=abcC3 =', ' abcC3b', ' abcC3l', " \n", ' abcC3b2'])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
493
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
494 call setreg('D', ["\n", 'abcD3b50'],'b50')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
495 call Assert_reg('D', "50", "abcD3\nabcD32\nabcD3b\n\n\nabcD3b50", "['abcD3', 'abcD32', 'abcD3b', '\n', 'abcD3b50']", "abcD3\nabcD32\nabcD3b\n\n\nabcD3b50", "['abcD3', 'abcD32', 'abcD3b', '\n', 'abcD3b50']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
496 call Assert_regput('D', ['==', '=abcD3 =', ' abcD32', ' abcD3b', " \n", ' abcD3b50'])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
497
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
498 " Setting lists with NLs with setreg()
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
499 call setreg('a', ['abcA4-0', "\n", "abcA4-2\n", "\nabcA4-3", "abcA4-4\nabcA4-4-2"])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
500 call Assert_reg('a', "V", "abcA4-0\n\n\nabcA4-2\n\n\nabcA4-3\nabcA4-4\nabcA4-4-2\n", "['abcA4-0', '\n', 'abcA4-2\n', '\nabcA4-3', 'abcA4-4\nabcA4-4-2']", "abcA4-0\n\n\nabcA4-2\n\n\nabcA4-3\nabcA4-4\nabcA4-4-2\n", "['abcA4-0', '\n', 'abcA4-2\n', '\nabcA4-3', 'abcA4-4\nabcA4-4-2']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
501 call Assert_regput('a', ['==', 'abcA4-0', "\n", "abcA4-2\n", "\nabcA4-3", "abcA4-4\nabcA4-4-2", '=='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
502
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
503 call setreg('b', ['abcB4c-0', "\n", "abcB4c-2\n", "\nabcB4c-3", "abcB4c-4\nabcB4c-4-2"], 'c')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
504 call Assert_reg('b', "v", "abcB4c-0\n\n\nabcB4c-2\n\n\nabcB4c-3\nabcB4c-4\nabcB4c-4-2", "['abcB4c-0', '\n', 'abcB4c-2\n', '\nabcB4c-3', 'abcB4c-4\nabcB4c-4-2']", "abcB4c-0\n\n\nabcB4c-2\n\n\nabcB4c-3\nabcB4c-4\nabcB4c-4-2", "['abcB4c-0', '\n', 'abcB4c-2\n', '\nabcB4c-3', 'abcB4c-4\nabcB4c-4-2']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
505 call Assert_regput('b', ['==', '=abcB4c-0', "\n", "abcB4c-2\n", "\nabcB4c-3", "abcB4c-4\nabcB4c-4-2="])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
506
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
507 call setreg('c', ['abcC4l-0', "\n", "abcC4l-2\n", "\nabcC4l-3", "abcC4l-4\nabcC4l-4-2"], 'l')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
508 call Assert_reg('c', "V", "abcC4l-0\n\n\nabcC4l-2\n\n\nabcC4l-3\nabcC4l-4\nabcC4l-4-2\n", "['abcC4l-0', '\n', 'abcC4l-2\n', '\nabcC4l-3', 'abcC4l-4\nabcC4l-4-2']", "abcC4l-0\n\n\nabcC4l-2\n\n\nabcC4l-3\nabcC4l-4\nabcC4l-4-2\n", "['abcC4l-0', '\n', 'abcC4l-2\n', '\nabcC4l-3', 'abcC4l-4\nabcC4l-4-2']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
509 call Assert_regput('c', ['==', 'abcC4l-0', "\n", "abcC4l-2\n", "\nabcC4l-3", "abcC4l-4\nabcC4l-4-2", '=='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
510
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
511 call setreg('d', ['abcD4b-0', "\n", "abcD4b-2\n", "\nabcD4b-3", "abcD4b-4\nabcD4b-4-2"], 'b')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
512 call Assert_reg('d', "19", "abcD4b-0\n\n\nabcD4b-2\n\n\nabcD4b-3\nabcD4b-4\nabcD4b-4-2", "['abcD4b-0', '\n', 'abcD4b-2\n', '\nabcD4b-3', 'abcD4b-4\nabcD4b-4-2']", "abcD4b-0\n\n\nabcD4b-2\n\n\nabcD4b-3\nabcD4b-4\nabcD4b-4-2", "['abcD4b-0', '\n', 'abcD4b-2\n', '\nabcD4b-3', 'abcD4b-4\nabcD4b-4-2']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
513 call Assert_regput('d', ['==', '=abcD4b-0 =', " \n", " abcD4b-2\n", " \nabcD4b-3", " abcD4b-4\nabcD4b-4-2"])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
514
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
515 call setreg('e', ['abcE4b10-0', "\n", "abcE4b10-2\n", "\nabcE4b10-3", "abcE4b10-4\nabcE4b10-4-2"], 'b10')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
516 call Assert_reg('e', "10", "abcE4b10-0\n\n\nabcE4b10-2\n\n\nabcE4b10-3\nabcE4b10-4\nabcE4b10-4-2", "['abcE4b10-0', '\n', 'abcE4b10-2\n', '\nabcE4b10-3', 'abcE4b10-4\nabcE4b10-4-2']", "abcE4b10-0\n\n\nabcE4b10-2\n\n\nabcE4b10-3\nabcE4b10-4\nabcE4b10-4-2", "['abcE4b10-0', '\n', 'abcE4b10-2\n', '\nabcE4b10-3', 'abcE4b10-4\nabcE4b10-4-2']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
517 call Assert_regput('e', ['==', '=abcE4b10-0=', " \n", " abcE4b10-2\n", " \nabcE4b10-3", " abcE4b10-4\nabcE4b10-4-2"])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
518
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
519 " Search and expressions
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
520 call setreg('/', ['abc/'])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
521 call Assert_reg('/', 'v', "abc/", "['abc/']", "abc/", "['abc/']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
522 call Assert_regput('/', ['==', '=abc/='])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
523
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
524 call setreg('/', ["abc/\n"])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
525 call Assert_reg('/', 'v', "abc/\n", "['abc/\n']", "abc/\n", "['abc/\n']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
526 call Assert_regput('/', ['==', "=abc/\n="])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
527
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
528 call setreg('=', ['"abc/"'])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
529 call Assert_reg('=', 'v', "abc/", "['abc/']", '"abc/"', "['\"abc/\"']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
530
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
531 call setreg('=', ["\"abc/\n\""])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
532 call Assert_reg('=', 'v', "abc/\n", "['abc/\n']", "\"abc/\n\"", "['\"abc/\n\"']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
533
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
534 " System clipboard
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
535 if has('clipboard')
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
536 new | only!
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
537 call setline(1, ['clipboard contents', 'something else'])
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
538 " Save and restore system clipboard.
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
539 " If no connection to X-Server is possible, test should succeed.
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
540 let _clipreg = ['*', getreg('*'), getregtype('*')]
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
541 let _clipopt = &cb
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
542 let &cb='unnamed'
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
543 1y
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
544 call Assert_reg('*', 'V', "clipboard contents\n", "['clipboard contents']", "clipboard contents\n", "['clipboard contents']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
545 tabdo :windo :echo "hi"
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
546 2y
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
547 call Assert_reg('*', 'V', "something else\n", "['something else']", "something else\n", "['something else']")
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
548 let &cb=_clipopt
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
549 call call('setreg', _clipreg)
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
550 enew!
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
551 endif
3a94b984c9f9 patch 8.2.0661: eval test is still old style
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
552
20109
e82996ad131f patch 8.2.0610: some tests are still old style
Bram Moolenaar <Bram@vim.org>
parents: 20085
diff changeset
553 " Error cases
e82996ad131f patch 8.2.0610: some tests are still old style
Bram Moolenaar <Bram@vim.org>
parents: 20085
diff changeset
554 call assert_fails('call setreg()', 'E119:')
e82996ad131f patch 8.2.0610: some tests are still old style
Bram Moolenaar <Bram@vim.org>
parents: 20085
diff changeset
555 call assert_fails('call setreg(1)', 'E119:')
e82996ad131f patch 8.2.0610: some tests are still old style
Bram Moolenaar <Bram@vim.org>
parents: 20085
diff changeset
556 call assert_fails('call setreg(1, 2, 3, 4)', 'E118:')
e82996ad131f patch 8.2.0610: some tests are still old style
Bram Moolenaar <Bram@vim.org>
parents: 20085
diff changeset
557 call assert_fails('call setreg([], 2)', 'E730:')
e82996ad131f patch 8.2.0610: some tests are still old style
Bram Moolenaar <Bram@vim.org>
parents: 20085
diff changeset
558 call assert_fails('call setreg(1, 2, [])', 'E730:')
e82996ad131f patch 8.2.0610: some tests are still old style
Bram Moolenaar <Bram@vim.org>
parents: 20085
diff changeset
559 call assert_fails('call setreg("/", ["1", "2"])', 'E883:')
e82996ad131f patch 8.2.0610: some tests are still old style
Bram Moolenaar <Bram@vim.org>
parents: 20085
diff changeset
560 call assert_fails('call setreg("=", ["1", "2"])', 'E883:')
e82996ad131f patch 8.2.0610: some tests are still old style
Bram Moolenaar <Bram@vim.org>
parents: 20085
diff changeset
561 call assert_fails('call setreg(1, ["", "", [], ""])', 'E730:')
20083
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
562 endfunc
0da696bd7352 patch 8.2.0597: test_eval is old style
Bram Moolenaar <Bram@vim.org>
parents: 19724
diff changeset
563
21658
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
564 func Test_curly_assignment()
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
565 let s:svar = 'svar'
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
566 let g:gvar = 'gvar'
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
567 let lname = 'gvar'
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
568 let gname = 'gvar'
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
569 let {'s:'.lname} = {'g:'.gname}
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
570 call assert_equal('gvar', s:gvar)
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
571 let s:gvar = ''
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
572 let { 's:'.lname } = { 'g:'.gname }
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
573 call assert_equal('gvar', s:gvar)
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
574 let s:gvar = ''
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
575 let { 's:' . lname } = { 'g:' . gname }
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
576 call assert_equal('gvar', s:gvar)
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
577 let s:gvar = ''
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
578 let { 's:' .. lname } = { 'g:' .. gname }
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
579 call assert_equal('gvar', s:gvar)
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
580
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
581 unlet s:svar
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
582 unlet s:gvar
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
583 unlet g:gvar
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
584 endfunc
140a9082f87c patch 8.2.1379: curly braces expression ending in " }" does not work
Bram Moolenaar <Bram@vim.org>
parents: 21267
diff changeset
585
19724
b3e93a05c3ca patch 8.2.0418: code in eval.c not sufficiently covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19477
diff changeset
586 " vim: shiftwidth=2 sts=2 expandtab