vim-patch:8.2.3908: cannot use a script-local function for 'foldtext'

Problem:    Cannot use a script-local function for 'foldtext'.
Solution:   Expand "s:" and "<SID>". (Yegappan Lakshmanan, closes vim/vim#9411)

27708e6c7b

Cherry-pick test_filter_map.vim change from patch 8.2.3871.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
zeertzjq
2023-08-17 13:01:45 +08:00
parent faef577e90
commit db64280be5
5 changed files with 18 additions and 3 deletions

View File

@@ -38,6 +38,7 @@ func Test_blob_create()
call assert_fails('VAR b = 0z001122.')
call assert_fails('call get("", 1)', 'E896:')
call assert_equal(0, len(v:_null_blob))
call assert_equal(0z, copy(v:_null_blob))
END
call CheckLegacyAndVim9Success(lines)
endfunc
@@ -370,6 +371,14 @@ func Test_blob_add()
add(v:_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()
@@ -464,6 +473,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()
@@ -524,6 +536,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
@@ -539,6 +552,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()