diff src/testdir/test_blob.vim @ 15589:44ea60ca593b v8.1.0802

patch 8.1.0802: negative index doesn't work for Blob commit https://github.com/vim/vim/commit/a5be9b62480a6f338a72c01e57c9edd0bca8048b Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 24 12:31:44 2019 +0100 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 https://github.com/vim/vim/issues/3856)
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Jan 2019 12:45:05 +0100
parents c2382f0d1279
children a0eb2ff0f297
line wrap: on
line diff
--- a/src/testdir/test_blob.vim
+++ b/src/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()