diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-01-15 20:51:34 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-01-15 20:51:34 +0100 |
commit | 49c57ce50019b667e5005ce1cfb8cdc2e48bf868 (patch) | |
tree | 5683331f6383a0b0ff30f58ffb032add0a2b6175 /src/testdir | |
parent | b3d33d8570bc49a7f90990572d7f9630a1bfae02 (diff) |
patch 8.2.0121: filter() and map() on blob don't workv8.2.0121
Problem: filter() and map() on blob don't work.
Solution: Correct the code. (closes #5483)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_blob.vim | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/testdir/test_blob.vim b/src/testdir/test_blob.vim index a4e9bea304..18d9c8a45b 100644 --- a/src/testdir/test_blob.vim +++ b/src/testdir/test_blob.vim @@ -260,18 +260,22 @@ endfunc " filter() item in blob func Test_blob_filter() - let b = 0zDEADBEEF - call filter(b, 'v:val != 0xEF') - call assert_equal(0zDEADBE, b) + call assert_equal(0z, filter(0zDEADBEEF, '0')) + call assert_equal(0zADBEEF, filter(0zDEADBEEF, 'v:val != 0xDE')) + call assert_equal(0zDEADEF, filter(0zDEADBEEF, 'v:val != 0xBE')) + call assert_equal(0zDEADBE, filter(0zDEADBEEF, 'v:val != 0xEF')) + call assert_equal(0zDEADBEEF, filter(0zDEADBEEF, '1')) + call assert_equal(0z01030103, filter(0z010203010203, 'v:val != 0x02')) + call assert_equal(0zADEF, filter(0zDEADBEEF, 'v:key % 2')) endfunc " map() item in blob func Test_blob_map() - let b = 0zDEADBEEF - call map(b, 'v:val + 1') - call assert_equal(0zDFAEBFF0, b) + call assert_equal(0zDFAEBFF0, map(0zDEADBEEF, 'v:val + 1')) + call assert_equal(0z00010203, map(0zDEADBEEF, 'v:key')) + call assert_equal(0zDEAEC0F2, map(0zDEADBEEF, 'v:key + v:val')) - call assert_fails("call map(b, '[9]')", 'E978:') + call assert_fails("call map(0z00, '[9]')", 'E978:') endfunc func Test_blob_index() |