vim-patch:9.1.0419: eval.c not sufficiently tested

Problem:  eval.c not sufficiently tested
Solution: Add a few more additional tests for eval.c,
          (Yegappan Lakshmanan)

closes: vim/vim#14799

4776e64e72

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
zeertzjq
2024-07-31 09:39:31 +08:00
parent 619cb143f9
commit 30f85fcb7f
5 changed files with 57 additions and 14 deletions

View File

@@ -7450,12 +7450,13 @@ func Test_for_over_string()
endfor
call assert_equal('', res)
" Test for ignoring loop var assignment
let c = 0
for _ in 'abc'
let c += 1
" Test for using "_" as the loop variable
let i = 0
let s = 'abc'
for _ in s
call assert_equal(s[i], _)
let i += 1
endfor
call assert_equal(3, c)
endfunc
" Test for deeply nested :source command {{{1