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).
This commit is contained in:
Sean Dewar 2021-09-16 18:43:58 +01:00
parent 29bc648d2b
commit 18b32fca67
No known key found for this signature in database
GPG Key ID: 08CC2C83AD41B581
2 changed files with 26 additions and 0 deletions

View File

@ -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",

View File

@ -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.