aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-09-16 18:43:58 +0100
committerSean Dewar <seandewar@users.noreply.github.com>2021-09-16 19:50:13 +0100
commit18b32fca675aed266875c1c8905e8f4ec1013d94 (patch)
treeac4812c798ff02407d72f4f382cff423cdd66200 /src
parent29bc648d2b259d434c46f3eb28d3513d2a4aef11 (diff)
downloadrneovim-18b32fca675aed266875c1c8905e8f4ec1013d94.tar.gz
rneovim-18b32fca675aed266875c1c8905e8f4ec1013d94.tar.bz2
rneovim-18b32fca675aed266875c1c8905e8f4ec1013d94.zip
fix(eval): add the vimscript-1 feature to has()
Include Test_string_concat_scriptversion1 to test that has('vimscript-1') works (excluding the :scriptversion 1 bit).
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval/funcs.c1
-rw-r--r--src/nvim/testdir/test_eval_stuff.vim25
2 files changed, 26 insertions, 0 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index 801b0f9d1c..dd83e762ca 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -4403,6 +4403,7 @@ static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr)
"user_commands",
"vartabs",
"vertsplit",
+ "vimscript-1",
"virtualedit",
"visual",
"visualextra",
diff --git a/src/nvim/testdir/test_eval_stuff.vim b/src/nvim/testdir/test_eval_stuff.vim
index 084c856ba0..eacf109928 100644
--- a/src/nvim/testdir/test_eval_stuff.vim
+++ b/src/nvim/testdir/test_eval_stuff.vim
@@ -138,6 +138,31 @@ func Test_let_errmsg()
let v:errmsg = ''
endfunc
+" scriptversion 1
+func Test_string_concat_scriptversion1()
+ call assert_true(has('vimscript-1'))
+ let a = 'a'
+ let b = 'b'
+
+ echo a . b
+ let a .= b
+ let vers = 1.2.3
+ call assert_equal('123', vers)
+
+ if has('float')
+ call assert_fails('let f = .5', 'E15:')
+ endif
+endfunc
+
+" scriptversion 1
+func Test_vvar_scriptversion1()
+ call assert_equal(15, 017)
+ call assert_equal(15, 0o17)
+ call assert_equal(15, 0O17)
+ call assert_equal(18, 018)
+ call assert_equal(511, 0o777)
+endfunc
+
func Test_number_max_min_size()
" This will fail on systems without 64 bit number support or when not
" configured correctly.