diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2024-05-19 09:06:50 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-05-19 09:06:50 +0200 |
commit | 4776e64e72de2976ff90b17d236e50e2b02c5540 (patch) | |
tree | 2e0a5c5ccbbebcec04e69e37a39a65b75cd69492 /src/testdir/test_vimscript.vim | |
parent | 5f757147303dbf4c5c3122bbabf77839c3725043 (diff) |
patch 9.1.0419: eval.c not sufficiently testedv9.1.0419
Problem: eval.c not sufficiently tested
Solution: Add a few more additional tests for eval.c,
(Yegappan Lakshmanan)
closes: #14799
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/testdir/test_vimscript.vim')
-rw-r--r-- | src/testdir/test_vimscript.vim | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/testdir/test_vimscript.vim b/src/testdir/test_vimscript.vim index c13530439e..897677957a 100644 --- a/src/testdir/test_vimscript.vim +++ b/src/testdir/test_vimscript.vim @@ -7510,12 +7510,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 |