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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user