summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-14 18:31:27 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-14 18:31:27 +0100
commit025cb1ca8605055383c53bf2c823d7093cf29b82 (patch)
tree27c018ac06cf62ea312c371400a7d41cf366ba13
parentec792290eb902e01c9edfc0cb71e5235833df56a (diff)
downloadvim-git-025cb1ca8605055383c53bf2c823d7093cf29b82.tar.gz
patch 8.2.2144: Vim9: some corner cases not testedv8.2.2144
Problem: Vim9: some corner cases not tested. Solution: Add a few tests.
-rw-r--r--src/testdir/test_vim9_cmd.vim17
-rw-r--r--src/testdir/test_vim9_script.vim20
-rw-r--r--src/version.c2
3 files changed, 27 insertions, 12 deletions
diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim
index 1986c0f71..95d696913 100644
--- a/src/testdir/test_vim9_cmd.vim
+++ b/src/testdir/test_vim9_cmd.vim
@@ -20,6 +20,9 @@ def Test_edit_wildcards()
edit X`=filename`xx`=filenr`yy
assert_equal('XXtestxx77yy', bufname())
+
+ CheckDefFailure(['edit `=xxx`'], 'E1001:')
+ CheckDefFailure(['edit `="foo"'], 'E1083:')
enddef
def Test_hardcopy_wildcards()
@@ -626,6 +629,20 @@ def Test_put_command()
assert_equal('aaa', getline(4))
bwipe!
+
+ CheckDefFailure(['put =xxx'], 'E1001:')
+enddef
+
+def Test_put_with_linebreak()
+ new
+ var lines =<< trim END
+ vim9script
+ pu =split('abc', '\zs')
+ ->join()
+ END
+ CheckScriptSuccess(lines)
+ getline(2)->assert_equal('a b c')
+ bwipe!
enddef
def Test_command_star_range()
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim
index ccc612f5a..2f651cd33 100644
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -23,6 +23,11 @@ def Test_range_only()
list
assert_equal('three$', Screenline(&lines))
bwipe!
+
+ # won't generate anything
+ if false
+ :123
+ endif
enddef
let g:alist = [7]
@@ -1890,6 +1895,9 @@ def Test_for_loop()
enddef
def Test_for_loop_fails()
+ CheckDefFailure(['for '], 'E1097:')
+ CheckDefFailure(['for x'], 'E1097:')
+ CheckDefFailure(['for x in'], 'E1097:')
CheckDefFailure(['for # in range(5)'], 'E690:')
CheckDefFailure(['for i In range(5)'], 'E690:')
CheckDefFailure(['var x = 5', 'for x in range(5)'], 'E1017:')
@@ -3054,18 +3062,6 @@ def Test_no_unknown_error_after_error()
delete('Xdef')
enddef
-def Test_put_with_linebreak()
- new
- var lines =<< trim END
- vim9script
- pu =split('abc', '\zs')
- ->join()
- END
- CheckScriptSuccess(lines)
- getline(2)->assert_equal('a b c')
- bwipe!
-enddef
-
def InvokeNormal()
exe "norm! :m+1\r"
enddef
diff --git a/src/version.c b/src/version.c
index be8c64a5e..dfd565126 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2144,
+/**/
2143,
/**/
2142,