Mercurial > vim
annotate src/testdir/test_vim9_builtin.vim @ 23314:7d09c9cdaab8 v8.2.2202
patch 8.2.2202: write file test still fails on MS-Windows
Commit: https://github.com/vim/vim/commit/16204962c7ad7380a40f0855443303ad16114e2b
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Dec 23 22:40:11 2020 +0100
patch 8.2.2202: write file test still fails on MS-Windows
Problem: Write file test still fails on MS-Windows.
Solution: Set fileformat with the :edit command
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 23 Dec 2020 22:45:03 +0100 |
parents | b79cdad3ea2e |
children | 9b86957ddd95 |
rev | line source |
---|---|
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 " Test using builtin functions in the Vim9 script language. |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 source check.vim |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4 source vim9.vim |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
6 " Test for passing too many or too few arguments to builtin functions |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
7 func Test_internalfunc_arg_error() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 let l =<< trim END |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 def! FArgErr(): float |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 return ceil(1.1, 2) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 defcompile |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 END |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 call writefile(l, 'Xinvalidarg') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 call assert_fails('so Xinvalidarg', 'E118:', '', 1, 'FArgErr') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 let l =<< trim END |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 def! FArgErr(): float |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 return ceil() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 defcompile |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 END |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 call writefile(l, 'Xinvalidarg') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
23 call assert_fails('so Xinvalidarg', 'E119:', '', 1, 'FArgErr') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
24 call delete('Xinvalidarg') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
25 endfunc |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
26 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
27 " Test for builtin functions returning different types |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
28 func Test_InternalFuncRetType() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
29 let lines =<< trim END |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
30 def RetFloat(): float |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
31 return ceil(1.456) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
32 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
33 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
34 def RetListAny(): list<any> |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
35 return items({k: 'v'}) |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
36 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
37 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
38 def RetListString(): list<string> |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
39 return split('a:b:c', ':') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
40 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
41 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
42 def RetListDictAny(): list<dict<any>> |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
43 return getbufinfo() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
44 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
45 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
46 def RetDictNumber(): dict<number> |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
47 return wordcount() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
48 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
49 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
50 def RetDictString(): dict<string> |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
51 return environ() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
52 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
53 END |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
54 call writefile(lines, 'Xscript') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
55 source Xscript |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
56 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
57 call RetFloat()->assert_equal(2.0) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
58 call RetListAny()->assert_equal([['k', 'v']]) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
59 call RetListString()->assert_equal(['a', 'b', 'c']) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
60 call RetListDictAny()->assert_notequal([]) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
61 call RetDictNumber()->assert_notequal({}) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
62 call RetDictString()->assert_notequal({}) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
63 call delete('Xscript') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
64 endfunc |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
65 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
66 def Test_abs() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
67 assert_equal(0, abs(0)) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
68 assert_equal(2, abs(-2)) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
69 assert_equal(3, abs(3)) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
70 CheckDefFailure(['abs("text")'], 'E1013: Argument 1: type mismatch, expected number but got string', 1) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
71 if has('float') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
72 assert_equal(0, abs(0)) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
73 assert_equal(2.0, abs(-2.0)) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
74 assert_equal(3.0, abs(3.0)) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
75 endif |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
76 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
77 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
78 def Test_add_list() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
79 var l: list<number> # defaults to empty list |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
80 add(l, 9) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
81 assert_equal([9], l) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
82 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
83 var lines =<< trim END |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
84 var l: list<number> |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
85 add(l, "x") |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
86 END |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
87 CheckDefFailure(lines, 'E1012:', 2) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
88 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
89 lines =<< trim END |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
90 var l: list<number> = test_null_list() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
91 add(l, 123) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
92 END |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
93 CheckDefExecFailure(lines, 'E1130:', 2) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
94 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
95 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
96 def Test_add_blob() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
97 var b1: blob = 0z12 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
98 add(b1, 0x34) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
99 assert_equal(0z1234, b1) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
100 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
101 var b2: blob # defaults to empty blob |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
102 add(b2, 0x67) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
103 assert_equal(0z67, b2) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
104 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
105 var lines =<< trim END |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
106 var b: blob |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
107 add(b, "x") |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
108 END |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
109 CheckDefFailure(lines, 'E1012:', 2) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
110 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
111 lines =<< trim END |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
112 var b: blob = test_null_blob() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
113 add(b, 123) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
114 END |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
115 CheckDefExecFailure(lines, 'E1131:', 2) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
116 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
117 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
118 def Test_bufname() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
119 split SomeFile |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
120 bufname('%')->assert_equal('SomeFile') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
121 edit OtherFile |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
122 bufname('#')->assert_equal('SomeFile') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
123 close |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
124 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
125 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
126 def Test_bufnr() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
127 var buf = bufnr() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
128 bufnr('%')->assert_equal(buf) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
129 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
130 buf = bufnr('Xdummy', true) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
131 buf->assert_notequal(-1) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
132 exe 'bwipe! ' .. buf |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
133 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
134 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
135 def Test_bufwinid() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
136 var origwin = win_getid() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
137 below split SomeFile |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
138 var SomeFileID = win_getid() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
139 below split OtherFile |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
140 below split SomeFile |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
141 bufwinid('SomeFile')->assert_equal(SomeFileID) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
142 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
143 win_gotoid(origwin) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
144 only |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
145 bwipe SomeFile |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
146 bwipe OtherFile |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
147 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
148 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
149 def Test_call_call() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
150 var l = [3, 2, 1] |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
151 call('reverse', [l]) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
152 l->assert_equal([1, 2, 3]) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
153 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
154 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
155 def Test_char2nr() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
156 char2nr('あ', true)->assert_equal(12354) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
157 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
158 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
159 def Test_col() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
160 new |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
161 setline(1, 'asdf') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
162 col([1, '$'])->assert_equal(5) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
163 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
164 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
165 def Test_copy_return_type() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
166 var l = copy([1, 2, 3]) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
167 var res = 0 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
168 for n in l |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
169 res += n |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
170 endfor |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
171 res->assert_equal(6) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
172 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
173 var dl = deepcopy([1, 2, 3]) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
174 res = 0 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
175 for n in dl |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
176 res += n |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
177 endfor |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
178 res->assert_equal(6) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
179 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
180 dl = deepcopy([1, 2, 3], true) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
181 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
182 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
183 def Test_count() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
184 count('ABC ABC ABC', 'b', true)->assert_equal(3) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
185 count('ABC ABC ABC', 'b', false)->assert_equal(0) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
186 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
187 |
23276
b79cdad3ea2e
patch 8.2.2184: Vim9: no error when using "2" for a line number
Bram Moolenaar <Bram@vim.org>
parents:
23175
diff
changeset
|
188 def Test_cursor() |
b79cdad3ea2e
patch 8.2.2184: Vim9: no error when using "2" for a line number
Bram Moolenaar <Bram@vim.org>
parents:
23175
diff
changeset
|
189 new |
b79cdad3ea2e
patch 8.2.2184: Vim9: no error when using "2" for a line number
Bram Moolenaar <Bram@vim.org>
parents:
23175
diff
changeset
|
190 setline(1, range(4)) |
b79cdad3ea2e
patch 8.2.2184: Vim9: no error when using "2" for a line number
Bram Moolenaar <Bram@vim.org>
parents:
23175
diff
changeset
|
191 cursor(2, 1) |
b79cdad3ea2e
patch 8.2.2184: Vim9: no error when using "2" for a line number
Bram Moolenaar <Bram@vim.org>
parents:
23175
diff
changeset
|
192 assert_equal(2, getcurpos()[1]) |
b79cdad3ea2e
patch 8.2.2184: Vim9: no error when using "2" for a line number
Bram Moolenaar <Bram@vim.org>
parents:
23175
diff
changeset
|
193 cursor('$', 1) |
b79cdad3ea2e
patch 8.2.2184: Vim9: no error when using "2" for a line number
Bram Moolenaar <Bram@vim.org>
parents:
23175
diff
changeset
|
194 assert_equal(4, getcurpos()[1]) |
b79cdad3ea2e
patch 8.2.2184: Vim9: no error when using "2" for a line number
Bram Moolenaar <Bram@vim.org>
parents:
23175
diff
changeset
|
195 |
b79cdad3ea2e
patch 8.2.2184: Vim9: no error when using "2" for a line number
Bram Moolenaar <Bram@vim.org>
parents:
23175
diff
changeset
|
196 var lines =<< trim END |
b79cdad3ea2e
patch 8.2.2184: Vim9: no error when using "2" for a line number
Bram Moolenaar <Bram@vim.org>
parents:
23175
diff
changeset
|
197 cursor('2', 1) |
b79cdad3ea2e
patch 8.2.2184: Vim9: no error when using "2" for a line number
Bram Moolenaar <Bram@vim.org>
parents:
23175
diff
changeset
|
198 END |
b79cdad3ea2e
patch 8.2.2184: Vim9: no error when using "2" for a line number
Bram Moolenaar <Bram@vim.org>
parents:
23175
diff
changeset
|
199 CheckDefExecAndScriptFailure(lines, 'E475:') |
b79cdad3ea2e
patch 8.2.2184: Vim9: no error when using "2" for a line number
Bram Moolenaar <Bram@vim.org>
parents:
23175
diff
changeset
|
200 enddef |
b79cdad3ea2e
patch 8.2.2184: Vim9: no error when using "2" for a line number
Bram Moolenaar <Bram@vim.org>
parents:
23175
diff
changeset
|
201 |
23142
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
202 def Test_executable() |
23175
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
203 assert_false(executable("")) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
204 assert_false(executable(test_null_string())) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
205 |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
206 CheckDefExecFailure(['echo executable(123)'], 'E928:') |
23142
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
207 CheckDefExecFailure(['echo executable(true)'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
208 enddef |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
209 |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
210 def Test_exepath() |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
211 CheckDefExecFailure(['echo exepath(true)'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
212 CheckDefExecFailure(['echo exepath(v:null)'], 'E928:') |
23175
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
213 CheckDefExecFailure(['echo exepath("")'], 'E1142:') |
23142
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
214 enddef |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
215 |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
216 def Test_expand() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
217 split SomeFile |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
218 expand('%', true, true)->assert_equal(['SomeFile']) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
219 close |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
220 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
221 |
22766
a7082e865ffd
patch 8.2.1931: Vim9: arguments of extend() not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
22679
diff
changeset
|
222 def Test_extend_arg_types() |
a7082e865ffd
patch 8.2.1931: Vim9: arguments of extend() not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
22679
diff
changeset
|
223 assert_equal([1, 2, 3], extend([1, 2], [3])) |
a7082e865ffd
patch 8.2.1931: Vim9: arguments of extend() not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
22679
diff
changeset
|
224 assert_equal([3, 1, 2], extend([1, 2], [3], 0)) |
a7082e865ffd
patch 8.2.1931: Vim9: arguments of extend() not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
22679
diff
changeset
|
225 assert_equal([1, 3, 2], extend([1, 2], [3], 1)) |
22898
a8bccb0634bc
patch 8.2.1996: Vim9: invalid error for argument of extend()
Bram Moolenaar <Bram@vim.org>
parents:
22766
diff
changeset
|
226 assert_equal([1, 3, 2], extend([1, 2], [3], s:number_one)) |
22766
a7082e865ffd
patch 8.2.1931: Vim9: arguments of extend() not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
22679
diff
changeset
|
227 |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
228 assert_equal({a: 1, b: 2, c: 3}, extend({a: 1, b: 2}, {c: 3})) |
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
229 assert_equal({a: 1, b: 4}, extend({a: 1, b: 2}, {b: 4})) |
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
230 assert_equal({a: 1, b: 2}, extend({a: 1, b: 2}, {b: 4}, 'keep')) |
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
231 assert_equal({a: 1, b: 2}, extend({a: 1, b: 2}, {b: 4}, s:string_keep)) |
22898
a8bccb0634bc
patch 8.2.1996: Vim9: invalid error for argument of extend()
Bram Moolenaar <Bram@vim.org>
parents:
22766
diff
changeset
|
232 |
a8bccb0634bc
patch 8.2.1996: Vim9: invalid error for argument of extend()
Bram Moolenaar <Bram@vim.org>
parents:
22766
diff
changeset
|
233 var res: list<dict<any>> |
a8bccb0634bc
patch 8.2.1996: Vim9: invalid error for argument of extend()
Bram Moolenaar <Bram@vim.org>
parents:
22766
diff
changeset
|
234 extend(res, map([1, 2], {_, v -> {}})) |
a8bccb0634bc
patch 8.2.1996: Vim9: invalid error for argument of extend()
Bram Moolenaar <Bram@vim.org>
parents:
22766
diff
changeset
|
235 assert_equal([{}, {}], res) |
22766
a7082e865ffd
patch 8.2.1931: Vim9: arguments of extend() not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
22679
diff
changeset
|
236 |
a7082e865ffd
patch 8.2.1931: Vim9: arguments of extend() not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
22679
diff
changeset
|
237 CheckDefFailure(['extend([1, 2], 3)'], 'E1013: Argument 2: type mismatch, expected list<number> but got number') |
a7082e865ffd
patch 8.2.1931: Vim9: arguments of extend() not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
22679
diff
changeset
|
238 CheckDefFailure(['extend([1, 2], ["x"])'], 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>') |
a7082e865ffd
patch 8.2.1931: Vim9: arguments of extend() not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
22679
diff
changeset
|
239 CheckDefFailure(['extend([1, 2], [3], "x")'], 'E1013: Argument 3: type mismatch, expected number but got string') |
a7082e865ffd
patch 8.2.1931: Vim9: arguments of extend() not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
22679
diff
changeset
|
240 |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
241 CheckDefFailure(['extend({a: 1}, 42)'], 'E1013: Argument 2: type mismatch, expected dict<number> but got number') |
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
242 CheckDefFailure(['extend({a: 1}, {b: "x"})'], 'E1013: Argument 2: type mismatch, expected dict<number> but got dict<string>') |
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
243 CheckDefFailure(['extend({a: 1}, {b: 2}, 1)'], 'E1013: Argument 3: type mismatch, expected string but got number') |
22766
a7082e865ffd
patch 8.2.1931: Vim9: arguments of extend() not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
22679
diff
changeset
|
244 enddef |
a7082e865ffd
patch 8.2.1931: Vim9: arguments of extend() not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
22679
diff
changeset
|
245 |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
246 def Test_extend_return_type() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
247 var l = extend([1, 2], [3]) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
248 var res = 0 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
249 for n in l |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
250 res += n |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
251 endfor |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
252 res->assert_equal(6) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
253 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
254 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
255 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
256 def Wrong_dict_key_type(items: list<number>): list<number> |
22936
00b0275ffe7f
patch 8.2.2015: Vim9: literal dict #{} is not like any other language
Bram Moolenaar <Bram@vim.org>
parents:
22898
diff
changeset
|
257 return filter(items, {_, val -> get({[val]: 1}, 'x')}) |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
258 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
259 |
23104
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
260 def Test_map_function_arg() |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
261 var lines =<< trim END |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
262 def MapOne(i: number, v: string): string |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
263 return i .. ':' .. v |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
264 enddef |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
265 var l = ['a', 'b', 'c'] |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
266 map(l, MapOne) |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
267 assert_equal(['0:a', '1:b', '2:c'], l) |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
268 END |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
269 CheckDefAndScriptSuccess(lines) |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
270 enddef |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
271 |
23142
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
272 def Test_filereadable() |
23175
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
273 assert_false(filereadable("")) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
274 assert_false(filereadable(test_null_string())) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
275 |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
276 CheckDefExecFailure(['echo filereadable(123)'], 'E928:') |
23142
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
277 CheckDefExecFailure(['echo filereadable(true)'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
278 enddef |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
279 |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
280 def Test_filewritable() |
23175
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
281 assert_false(filewritable("")) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
282 assert_false(filewritable(test_null_string())) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
283 |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
284 CheckDefExecFailure(['echo filewritable(123)'], 'E928:') |
23142
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
285 CheckDefExecFailure(['echo filewritable(true)'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
286 enddef |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
287 |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
288 def Test_finddir() |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
289 CheckDefExecFailure(['echo finddir(true)'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
290 CheckDefExecFailure(['echo finddir(v:null)'], 'E928:') |
23175
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
291 CheckDefExecFailure(['echo finddir("")'], 'E1142:') |
23142
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
292 enddef |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
293 |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
294 def Test_findfile() |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
295 CheckDefExecFailure(['echo findfile(true)'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
296 CheckDefExecFailure(['echo findfile(v:null)'], 'E928:') |
23175
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
297 CheckDefExecFailure(['echo findfile("")'], 'E1142:') |
23142
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
298 enddef |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
299 |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
300 def Test_fnamemodify() |
23175
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
301 CheckDefSuccess(['echo fnamemodify(test_null_string(), ":p")']) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
302 CheckDefSuccess(['echo fnamemodify("", ":p")']) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
303 CheckDefSuccess(['echo fnamemodify("file", test_null_string())']) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
304 CheckDefSuccess(['echo fnamemodify("file", "")']) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
305 |
23142
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
306 CheckDefExecFailure(['echo fnamemodify(true, ":p")'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
307 CheckDefExecFailure(['echo fnamemodify(v:null, ":p")'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
308 CheckDefExecFailure(['echo fnamemodify("file", true)'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
309 enddef |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
310 |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
311 def Test_filter_wrong_dict_key_type() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
312 assert_fails('Wrong_dict_key_type([1, 2, 3])', 'E1012:') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
313 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
314 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
315 def Test_filter_return_type() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
316 var l = filter([1, 2, 3], {-> 1}) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
317 var res = 0 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
318 for n in l |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
319 res += n |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
320 endfor |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
321 res->assert_equal(6) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
322 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
323 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
324 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
325 def Test_garbagecollect() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
326 garbagecollect(true) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
327 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
328 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
329 def Test_getbufinfo() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
330 var bufinfo = getbufinfo(bufnr()) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
331 getbufinfo('%')->assert_equal(bufinfo) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
332 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
333 edit Xtestfile1 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
334 hide edit Xtestfile2 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
335 hide enew |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
336 getbufinfo({bufloaded: true, buflisted: true, bufmodified: false}) |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
337 ->len()->assert_equal(3) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
338 bwipe Xtestfile1 Xtestfile2 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
339 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
340 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
341 def Test_getbufline() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
342 e SomeFile |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
343 var buf = bufnr() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
344 e # |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
345 var lines = ['aaa', 'bbb', 'ccc'] |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
346 setbufline(buf, 1, lines) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
347 getbufline('#', 1, '$')->assert_equal(lines) |
22679
9fa3f92248f6
patch 8.2.1888: Vim9: getbufline(-1, 1, '$') gives an error
Bram Moolenaar <Bram@vim.org>
parents:
22661
diff
changeset
|
348 getbufline(-1, '$', '$')->assert_equal([]) |
9fa3f92248f6
patch 8.2.1888: Vim9: getbufline(-1, 1, '$') gives an error
Bram Moolenaar <Bram@vim.org>
parents:
22661
diff
changeset
|
349 getbufline(-1, 1, '$')->assert_equal([]) |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
350 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
351 bwipe! |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
352 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
353 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
354 def Test_getchangelist() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
355 new |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
356 setline(1, 'some text') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
357 var changelist = bufnr()->getchangelist() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
358 getchangelist('%')->assert_equal(changelist) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
359 bwipe! |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
360 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
361 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
362 def Test_getchar() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
363 while getchar(0) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
364 endwhile |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
365 getchar(true)->assert_equal(0) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
366 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
367 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
368 def Test_getcompletion() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
369 set wildignore=*.vim,*~ |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
370 var l = getcompletion('run', 'file', true) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
371 l->assert_equal([]) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
372 set wildignore& |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
373 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
374 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
375 def Test_getloclist_return_type() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
376 var l = getloclist(1) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
377 l->assert_equal([]) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
378 |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
379 var d = getloclist(1, {items: 0}) |
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
380 d->assert_equal({items: []}) |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
381 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
382 |
23142
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
383 def Test_getfperm() |
23175
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
384 assert_equal('', getfperm("")) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
385 assert_equal('', getfperm(test_null_string())) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
386 |
23142
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
387 CheckDefExecFailure(['echo getfperm(true)'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
388 CheckDefExecFailure(['echo getfperm(v:null)'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
389 enddef |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
390 |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
391 def Test_getfsize() |
23175
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
392 assert_equal(-1, getfsize("")) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
393 assert_equal(-1, getfsize(test_null_string())) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
394 |
23142
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
395 CheckDefExecFailure(['echo getfsize(true)'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
396 CheckDefExecFailure(['echo getfsize(v:null)'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
397 enddef |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
398 |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
399 def Test_getftime() |
23175
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
400 assert_equal(-1, getftime("")) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
401 assert_equal(-1, getftime(test_null_string())) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
402 |
23142
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
403 CheckDefExecFailure(['echo getftime(true)'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
404 CheckDefExecFailure(['echo getftime(v:null)'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
405 enddef |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
406 |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
407 def Test_getftype() |
23175
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
408 assert_equal('', getftype("")) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
409 assert_equal('', getftype(test_null_string())) |
d7294a6220ac
patch 8.2.2133: Vim9: checking for a non-empty string is too strict
Bram Moolenaar <Bram@vim.org>
parents:
23142
diff
changeset
|
410 |
23142
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
411 CheckDefExecFailure(['echo getftype(true)'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
412 CheckDefExecFailure(['echo getftype(v:null)'], 'E928:') |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
413 enddef |
5f08d4a42898
patch 8.2.2117: some functions use any value as a string
Bram Moolenaar <Bram@vim.org>
parents:
23104
diff
changeset
|
414 |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
415 def Test_getqflist_return_type() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
416 var l = getqflist() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
417 l->assert_equal([]) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
418 |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
419 var d = getqflist({items: 0}) |
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
420 d->assert_equal({items: []}) |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
421 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
422 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
423 def Test_getreg() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
424 var lines = ['aaa', 'bbb', 'ccc'] |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
425 setreg('a', lines) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
426 getreg('a', true, true)->assert_equal(lines) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
427 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
428 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
429 def Test_getreg_return_type() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
430 var s1: string = getreg('"') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
431 var s2: string = getreg('"', 1) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
432 var s3: list<string> = getreg('"', 1, 1) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
433 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
434 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
435 def Test_glob() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
436 glob('runtest.vim', true, true, true)->assert_equal(['runtest.vim']) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
437 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
438 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
439 def Test_globpath() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
440 globpath('.', 'runtest.vim', true, true, true)->assert_equal(['./runtest.vim']) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
441 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
442 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
443 def Test_has() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
444 has('eval', true)->assert_equal(1) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
445 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
446 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
447 def Test_hasmapto() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
448 hasmapto('foobar', 'i', true)->assert_equal(0) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
449 iabbrev foo foobar |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
450 hasmapto('foobar', 'i', true)->assert_equal(1) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
451 iunabbrev foo |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
452 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
453 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
454 def Test_index() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
455 index(['a', 'b', 'a', 'B'], 'b', 2, true)->assert_equal(3) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
456 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
457 |
22898
a8bccb0634bc
patch 8.2.1996: Vim9: invalid error for argument of extend()
Bram Moolenaar <Bram@vim.org>
parents:
22766
diff
changeset
|
458 let s:number_one = 1 |
a8bccb0634bc
patch 8.2.1996: Vim9: invalid error for argument of extend()
Bram Moolenaar <Bram@vim.org>
parents:
22766
diff
changeset
|
459 let s:number_two = 2 |
a8bccb0634bc
patch 8.2.1996: Vim9: invalid error for argument of extend()
Bram Moolenaar <Bram@vim.org>
parents:
22766
diff
changeset
|
460 let s:string_keep = 'keep' |
a8bccb0634bc
patch 8.2.1996: Vim9: invalid error for argument of extend()
Bram Moolenaar <Bram@vim.org>
parents:
22766
diff
changeset
|
461 |
22661
c6b17787a38f
patch 8.2.1879: Vim9: argument types of insert() not checked when compiling
Bram Moolenaar <Bram@vim.org>
parents:
22655
diff
changeset
|
462 def Test_insert() |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
463 var l = insert([2, 1], 3) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
464 var res = 0 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
465 for n in l |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
466 res += n |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
467 endfor |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
468 res->assert_equal(6) |
22661
c6b17787a38f
patch 8.2.1879: Vim9: argument types of insert() not checked when compiling
Bram Moolenaar <Bram@vim.org>
parents:
22655
diff
changeset
|
469 |
c6b17787a38f
patch 8.2.1879: Vim9: argument types of insert() not checked when compiling
Bram Moolenaar <Bram@vim.org>
parents:
22655
diff
changeset
|
470 assert_equal([1, 2, 3], insert([2, 3], 1)) |
22898
a8bccb0634bc
patch 8.2.1996: Vim9: invalid error for argument of extend()
Bram Moolenaar <Bram@vim.org>
parents:
22766
diff
changeset
|
471 assert_equal([1, 2, 3], insert([2, 3], s:number_one)) |
22661
c6b17787a38f
patch 8.2.1879: Vim9: argument types of insert() not checked when compiling
Bram Moolenaar <Bram@vim.org>
parents:
22655
diff
changeset
|
472 assert_equal([1, 2, 3], insert([1, 2], 3, 2)) |
22898
a8bccb0634bc
patch 8.2.1996: Vim9: invalid error for argument of extend()
Bram Moolenaar <Bram@vim.org>
parents:
22766
diff
changeset
|
473 assert_equal([1, 2, 3], insert([1, 2], 3, s:number_two)) |
22661
c6b17787a38f
patch 8.2.1879: Vim9: argument types of insert() not checked when compiling
Bram Moolenaar <Bram@vim.org>
parents:
22655
diff
changeset
|
474 assert_equal(['a', 'b', 'c'], insert(['b', 'c'], 'a')) |
c6b17787a38f
patch 8.2.1879: Vim9: argument types of insert() not checked when compiling
Bram Moolenaar <Bram@vim.org>
parents:
22655
diff
changeset
|
475 assert_equal(0z1234, insert(0z34, 0x12)) |
22898
a8bccb0634bc
patch 8.2.1996: Vim9: invalid error for argument of extend()
Bram Moolenaar <Bram@vim.org>
parents:
22766
diff
changeset
|
476 |
22661
c6b17787a38f
patch 8.2.1879: Vim9: argument types of insert() not checked when compiling
Bram Moolenaar <Bram@vim.org>
parents:
22655
diff
changeset
|
477 CheckDefFailure(['insert([2, 3], "a")'], 'E1013: Argument 2: type mismatch, expected number but got string', 1) |
c6b17787a38f
patch 8.2.1879: Vim9: argument types of insert() not checked when compiling
Bram Moolenaar <Bram@vim.org>
parents:
22655
diff
changeset
|
478 CheckDefFailure(['insert([2, 3], 1, "x")'], 'E1013: Argument 3: type mismatch, expected number but got string', 1) |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
479 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
480 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
481 def Test_keys_return_type() |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
482 const var: list<string> = {a: 1, b: 2}->keys() |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
483 var->assert_equal(['a', 'b']) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
484 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
485 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
486 def Test_list2str_str2list_utf8() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
487 var s = "\u3042\u3044" |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
488 var l = [0x3042, 0x3044] |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
489 str2list(s, true)->assert_equal(l) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
490 list2str(l, true)->assert_equal(s) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
491 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
492 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
493 def SID(): number |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
494 return expand('<SID>') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
495 ->matchstr('<SNR>\zs\d\+\ze_$') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
496 ->str2nr() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
497 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
498 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
499 def Test_maparg() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
500 var lnum = str2nr(expand('<sflnum>')) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
501 map foo bar |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
502 maparg('foo', '', false, true)->assert_equal({ |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
503 lnum: lnum + 1, |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
504 script: 0, |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
505 mode: ' ', |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
506 silent: 0, |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
507 noremap: 0, |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
508 lhs: 'foo', |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
509 lhsraw: 'foo', |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
510 nowait: 0, |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
511 expr: 0, |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
512 sid: SID(), |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
513 rhs: 'bar', |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
514 buffer: 0}) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
515 unmap foo |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
516 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
517 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
518 def Test_mapcheck() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
519 iabbrev foo foobar |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
520 mapcheck('foo', 'i', true)->assert_equal('foobar') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
521 iunabbrev foo |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
522 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
523 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
524 def Test_maparg_mapset() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
525 nnoremap <F3> :echo "hit F3"<CR> |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
526 var mapsave = maparg('<F3>', 'n', false, true) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
527 mapset('n', false, mapsave) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
528 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
529 nunmap <F3> |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
530 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
531 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
532 def Test_nr2char() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
533 nr2char(97, true)->assert_equal('a') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
534 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
535 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
536 def Test_readdir() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
537 eval expand('sautest')->readdir({e -> e[0] !=# '.'}) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
538 eval expand('sautest')->readdirex({e -> e.name[0] !=# '.'}) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
539 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
540 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
541 def Test_remove_return_type() |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
542 var l = remove({one: [1, 2], two: [3, 4]}, 'one') |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
543 var res = 0 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
544 for n in l |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
545 res += n |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
546 endfor |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
547 res->assert_equal(3) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
548 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
549 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
550 def Test_reverse_return_type() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
551 var l = reverse([1, 2, 3]) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
552 var res = 0 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
553 for n in l |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
554 res += n |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
555 endfor |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
556 res->assert_equal(6) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
557 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
558 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
559 def Test_search() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
560 new |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
561 setline(1, ['foo', 'bar']) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
562 var val = 0 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
563 # skip expr returns boolean |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
564 search('bar', 'W', 0, 0, {-> val == 1})->assert_equal(2) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
565 :1 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
566 search('bar', 'W', 0, 0, {-> val == 0})->assert_equal(0) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
567 # skip expr returns number, only 0 and 1 are accepted |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
568 :1 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
569 search('bar', 'W', 0, 0, {-> 0})->assert_equal(2) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
570 :1 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
571 search('bar', 'W', 0, 0, {-> 1})->assert_equal(0) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
572 assert_fails("search('bar', '', 0, 0, {-> -1})", 'E1023:') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
573 assert_fails("search('bar', '', 0, 0, {-> -1})", 'E1023:') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
574 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
575 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
576 def Test_searchcount() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
577 new |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
578 setline(1, "foo bar") |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
579 :/foo |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
580 searchcount({recompute: true}) |
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
581 ->assert_equal({ |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
582 exact_match: 1, |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
583 current: 1, |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
584 total: 1, |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
585 maxcount: 99, |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
586 incomplete: 0}) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
587 bwipe! |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
588 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
589 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
590 def Test_searchdecl() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
591 searchdecl('blah', true, true)->assert_equal(1) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
592 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
593 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
594 def Test_setbufvar() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
595 setbufvar(bufnr('%'), '&syntax', 'vim') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
596 &syntax->assert_equal('vim') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
597 setbufvar(bufnr('%'), '&ts', 16) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
598 &ts->assert_equal(16) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
599 settabwinvar(1, 1, '&syntax', 'vam') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
600 &syntax->assert_equal('vam') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
601 settabwinvar(1, 1, '&ts', 15) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
602 &ts->assert_equal(15) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
603 setlocal ts=8 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
604 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
605 setbufvar('%', 'myvar', 123) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
606 getbufvar('%', 'myvar')->assert_equal(123) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
607 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
608 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
609 def Test_setloclist() |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
610 var items = [{filename: '/tmp/file', lnum: 1, valid: true}] |
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
611 var what = {items: items} |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
612 setqflist([], ' ', what) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
613 setloclist(0, [], ' ', what) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
614 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
615 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
616 def Test_setreg() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
617 setreg('a', ['aaa', 'bbb', 'ccc']) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
618 var reginfo = getreginfo('a') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
619 setreg('a', reginfo) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
620 getreginfo('a')->assert_equal(reginfo) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
621 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
622 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
623 def Test_spellsuggest() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
624 if !has('spell') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
625 MissingFeature 'spell' |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
626 else |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
627 spellsuggest('marrch', 1, true)->assert_equal(['March']) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
628 endif |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
629 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
630 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
631 def Test_sort_return_type() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
632 var res: list<number> |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
633 res = [1, 2, 3]->sort() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
634 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
635 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
636 def Test_sort_argument() |
23104
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
637 var lines =<< trim END |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
638 var res = ['b', 'a', 'c']->sort('i') |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
639 res->assert_equal(['a', 'b', 'c']) |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
640 |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
641 def Compare(a: number, b: number): number |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
642 return a - b |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
643 enddef |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
644 var l = [3, 6, 7, 1, 8, 2, 4, 5] |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
645 sort(l, Compare) |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
646 assert_equal([1, 2, 3, 4, 5, 6, 7, 8], l) |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
647 END |
1013a97d5dc0
patch 8.2.2098: Vim9: function argument of sort() and map() not tested
Bram Moolenaar <Bram@vim.org>
parents:
23072
diff
changeset
|
648 CheckDefAndScriptSuccess(lines) |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
649 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
650 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
651 def Test_split() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
652 split(' aa bb ', '\W\+', true)->assert_equal(['', 'aa', 'bb', '']) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
653 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
654 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
655 def Test_str2nr() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
656 str2nr("1'000'000", 10, true)->assert_equal(1000000) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
657 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
658 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
659 def Test_strchars() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
660 strchars("A\u20dd", true)->assert_equal(1) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
661 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
662 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
663 def Test_submatch() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
664 var pat = 'A\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)' |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
665 var Rep = {-> range(10)->map({_, v -> submatch(v, true)})->string()} |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
666 var actual = substitute('A123456789', pat, Rep, '') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
667 var expected = "[['A123456789'], ['1'], ['2'], ['3'], ['4'], ['5'], ['6'], ['7'], ['8'], ['9']]" |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
668 actual->assert_equal(expected) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
669 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
670 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
671 def Test_synID() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
672 new |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
673 setline(1, "text") |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
674 synID(1, 1, true)->assert_equal(0) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
675 bwipe! |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
676 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
677 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
678 def Test_term_gettty() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
679 if !has('terminal') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
680 MissingFeature 'terminal' |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
681 else |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
682 var buf = Run_shell_in_terminal({}) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
683 term_gettty(buf, true)->assert_notequal('') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
684 StopShellInTerminal(buf) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
685 endif |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
686 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
687 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
688 def Test_term_start() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
689 if !has('terminal') |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
690 MissingFeature 'terminal' |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
691 else |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
692 botright new |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
693 var winnr = winnr() |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
694 term_start(&shell, {curwin: true}) |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
695 winnr()->assert_equal(winnr) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
696 bwipe! |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
697 endif |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
698 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
699 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
700 def Test_timer_paused() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
701 var id = timer_start(50, {-> 0}) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
702 timer_pause(id, true) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
703 var info = timer_info(id) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
704 info[0]['paused']->assert_equal(1) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
705 timer_stop(id) |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
706 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
707 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
708 def Test_win_splitmove() |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
709 split |
23072
4b398a229b0b
patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax
Bram Moolenaar <Bram@vim.org>
parents:
22936
diff
changeset
|
710 win_splitmove(1, 2, {vertical: true, rightbelow: true}) |
22655
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
711 close |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
712 enddef |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
713 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
714 |
eabe2c1444ea
patch 8.2.1876: Vim9: argument types are not checked at compile time
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
715 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker |