0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

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 #3856)
This commit is contained in:
Bram Moolenaar
2019-01-24 12:31:44 +01:00
parent fb1199d934
commit a5be9b6248
5 changed files with 20 additions and 6 deletions

View File

@@ -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()