diff options
Diffstat (limited to 'test/old/testdir/test_blob.vim')
-rw-r--r-- | test/old/testdir/test_blob.vim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/old/testdir/test_blob.vim b/test/old/testdir/test_blob.vim index 3886be48bd..fbc080059e 100644 --- a/test/old/testdir/test_blob.vim +++ b/test/old/testdir/test_blob.vim @@ -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 |