mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
vim-patch:9.1.0415: Some functions are not tested
Problem: Some functions are not tested
Solution: Add a few more tests, fix a few minor problems
(Yegappan Lakshmanan)
closes: vim/vim#14789
fe424d13ef
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
@@ -75,6 +75,13 @@ func Test_blob_assign()
|
||||
VAR l = [0z12]
|
||||
VAR m = deepcopy(l)
|
||||
LET m[0] = 0z34 #" E742 or E741 should not occur.
|
||||
|
||||
VAR blob1 = 0z10
|
||||
LET blob1 += v:_null_blob
|
||||
call assert_equal(0z10, blob1)
|
||||
LET blob1 = v:_null_blob
|
||||
LET blob1 += 0z20
|
||||
call assert_equal(0z20, blob1)
|
||||
END
|
||||
call CheckLegacyAndVim9Success(lines)
|
||||
|
||||
@@ -332,6 +339,17 @@ func Test_blob_for_loop()
|
||||
call assert_equal(5, i)
|
||||
END
|
||||
call CheckLegacyAndVim9Success(lines)
|
||||
|
||||
" Test for skipping the loop var assignment in a for loop
|
||||
let lines =<< trim END
|
||||
VAR blob = 0z998877
|
||||
VAR c = 0
|
||||
for _ in blob
|
||||
LET c += 1
|
||||
endfor
|
||||
call assert_equal(3, c)
|
||||
END
|
||||
call CheckLegacyAndVim9Success(lines)
|
||||
endfunc
|
||||
|
||||
func Test_blob_concatenate()
|
||||
@@ -851,6 +869,7 @@ func Test_indexof()
|
||||
call assert_equal(-1, indexof(b, v:_null_string))
|
||||
" Nvim doesn't have null functions
|
||||
" call assert_equal(-1, indexof(b, test_null_function()))
|
||||
call assert_equal(-1, indexof(b, ""))
|
||||
|
||||
let b = 0z01020102
|
||||
call assert_equal(1, indexof(b, "v:val == 0x02", #{startidx: 0}))
|
||||
@@ -862,6 +881,7 @@ func Test_indexof()
|
||||
" failure cases
|
||||
call assert_fails('let i = indexof(b, "val == 0xde")', 'E121:')
|
||||
call assert_fails('let i = indexof(b, {})', 'E1256:')
|
||||
call assert_fails('let i = indexof(b, " ")', 'E15:')
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
Reference in New Issue
Block a user