summaryrefslogtreecommitdiff
path: root/src/testdir/test_blob.vim
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2021-12-26 21:54:43 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-26 21:54:43 +0000
commit27708e6c7b6f444fd599f3dc5015336b002b874d (patch)
treeca58fb2aa05c18a8149600a23c08603a19e02caa /src/testdir/test_blob.vim
parentc553a21e189aa440515a19c5b25f8b6b50c5d53d (diff)
downloadvim-git-27708e6c7b6f444fd599f3dc5015336b002b874d.tar.gz
patch 8.2.3908: cannot use a script-local function for 'foldtext'v8.2.3908
Problem: Cannot use a script-local function for 'foldtext'. Solution: Expand "s:" and "<SID>". (Yegappan Lakshmanan, closes #9411)
Diffstat (limited to 'src/testdir/test_blob.vim')
-rw-r--r--src/testdir/test_blob.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/testdir/test_blob.vim b/src/testdir/test_blob.vim
index 3ce95756f..69c86963c 100644
--- a/src/testdir/test_blob.vim
+++ b/src/testdir/test_blob.vim
@@ -37,6 +37,7 @@ func Test_blob_create()
call assert_fails('VAR b = 0z001122.')
call assert_fails('call get("", 1)', 'E896:')
call assert_equal(0, len(test_null_blob()))
+ call assert_equal(0z, copy(test_null_blob()))
END
call CheckLegacyAndVim9Success(lines)
endfunc
@@ -369,6 +370,14 @@ func Test_blob_add()
add(test_null_blob(), 0x22)
END
call CheckDefExecAndScriptFailure(lines, 'E1131:')
+
+ let lines =<< trim END
+ let b = 0zDEADBEEF
+ lockvar b
+ call add(b, 0)
+ unlockvar b
+ END
+ call CheckScriptFailure(lines, 'E741:')
endfunc
func Test_blob_empty()
@@ -445,6 +454,9 @@ func Test_blob_func_remove()
remove(b, 0)
END
call CheckScriptFailure(lines, 'E741:')
+
+ call assert_fails('echo remove(0z1020, [])', 'E745:')
+ call assert_fails('echo remove(0z1020, 0, [])', 'E745:')
endfunc
func Test_blob_read_write()
@@ -474,6 +486,7 @@ func Test_blob_filter()
call assert_equal(0zADEF, filter(0zDEADBEEF, 'v:key % 2'))
END
call CheckLegacyAndVim9Success(lines)
+ call assert_fails('echo filter(0z10, "a10")', 'E121:')
endfunc
" map() item in blob
@@ -489,6 +502,7 @@ func Test_blob_map()
call map(0z00, '[9]')
END
call CheckLegacyAndVim9Failure(lines, 'E978:')
+ call assert_fails('echo map(0z10, "a10")', 'E121:')
endfunc
func Test_blob_index()