diff options
| author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-07-29 22:54:47 +0100 |
|---|---|---|
| committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-09-15 22:57:47 +0100 |
| commit | bd9c787b4f3ec6d539246c24499bdf80c85248cf (patch) | |
| tree | 3dd40ef5d120181c2d5169ecc1ed15d3970a4837 /src/nvim/testdir | |
| parent | 23f5999d28cdee049661ed38e22812a063e78fad (diff) | |
| download | rneovim-bd9c787b4f3ec6d539246c24499bdf80c85248cf.tar.gz rneovim-bd9c787b4f3ec6d539246c24499bdf80c85248cf.tar.bz2 rneovim-bd9c787b4f3ec6d539246c24499bdf80c85248cf.zip | |
vim-patch:8.1.0802: negative index doesn't work for Blob
Problem: Negative index doesn't work for Blob.
Solution: Make it work, add a test. (closes vim/vim#3856)
https://github.com/vim/vim/commit/a5be9b62480a6f338a72c01e57c9edd0bca8048b
Leave tv_blob_get()'s return type untouched.
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_blob.vim | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_blob.vim b/src/nvim/testdir/test_blob.vim index 568821f564..1faa9af32c 100644 --- a/src/nvim/testdir/test_blob.vim +++ b/src/nvim/testdir/test_blob.vim @@ -95,6 +95,13 @@ func Test_blob_get() call assert_equal(999, get(b, 5, 999)) call assert_equal(-1, get(b, -8)) call assert_equal(999, get(b, -8, 999)) + + call assert_equal(0x00, b[0]) + call assert_equal(0x22, b[2]) + call assert_equal(0x44, b[4]) + call assert_equal(0x44, b[-1]) + call assert_fails('echo b[5]', 'E979:') + call assert_fails('echo b[-8]', 'E979:') endfunc func Test_blob_to_string() |