summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-05 10:53:21 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-05 10:53:21 +0200
commitbb1b5e24ecc0abe1fee164e9de13796989eff784 (patch)
treecd42f7d7632663f57a56c31026392f9d26f72444 /src/testdir
parent282f9c64e570e832d3eba12950da15c9f1a40f06 (diff)
downloadvim-git-bb1b5e24ecc0abe1fee164e9de13796989eff784.tar.gz
patch 8.2.1365: Vim9: no error for missing white space around operatorv8.2.1365
Problem: Vim9: no error for missing white space around operator. Solution: Check for white space. (closes #6618)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_vim9_expr.vim33
-rw-r--r--src/testdir/test_vim9_func.vim2
2 files changed, 34 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index 584126ff1..7e53a287d 100644
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -872,6 +872,39 @@ def Test_expr5_vim9script()
echo 'abc' isnot? 'abc'
END
CheckScriptFailure(lines, 'E15:')
+
+ # check white space
+ lines =<< trim END
+ vim9script
+ echo 5+6
+ END
+ CheckScriptFailure(lines, 'E1004:')
+ lines =<< trim END
+ vim9script
+ echo 5 +6
+ END
+ CheckScriptFailure(lines, 'E1004:')
+ lines =<< trim END
+ vim9script
+ echo 5+ 6
+ END
+ CheckScriptFailure(lines, 'E1004:')
+
+ lines =<< trim END
+ vim9script
+ echo 'a'..'b'
+ END
+ CheckScriptFailure(lines, 'E1004:')
+ lines =<< trim END
+ vim9script
+ echo 'a' ..'b'
+ END
+ CheckScriptFailure(lines, 'E1004:')
+ lines =<< trim END
+ vim9script
+ echo 'a'.. 'b'
+ END
+ CheckScriptFailure(lines, 'E1004:')
enddef
def Test_expr5_float()
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim
index f3fc4c7be..d0248369c 100644
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -1270,7 +1270,7 @@ enddef
def TreeWalk(dir: string): list<any>
return readdir(dir)->map({_, val ->
fnamemodify(dir .. '/' .. val, ':p')->isdirectory()
- ? {val : TreeWalk(dir .. '/' .. val)}
+ ? {val: TreeWalk(dir .. '/' .. val)}
: val
})
enddef