summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_normal.vim
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2021-12-24 20:47:38 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-24 20:47:38 +0000
commite7f4abd38b6e05100c699900c8f87281e363beb2 (patch)
treebadec536bcfe024c7214b18fcce1fa58e5315f80 /src/testdir/test_normal.vim
parent73a024209cbfbd5b39a2e974084d807c6131e2ed (diff)
patch 8.2.3889: duplicate code for translating script-local function namev8.2.3889
Problem: Duplicate code for translating script-local function name. Solution: Move the code to get_scriptlocal_funcname(). (Yegappan Lakshmanan, closes #9393)
Diffstat (limited to 'src/testdir/test_normal.vim')
-rw-r--r--src/testdir/test_normal.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index 08539deb05..57ea6d3ecc 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -642,6 +642,18 @@ func Test_opfunc_callback()
END
call CheckScriptSuccess(lines)
+ " setting 'opfunc' to a script local function outside of a script context
+ " should fail
+ let cleanup =<< trim END
+ call writefile([execute('messages')], 'Xtest.out')
+ qall
+ END
+ call writefile(cleanup, 'Xverify.vim')
+ call RunVim([], [], "-c \"set opfunc=s:abc\" -S Xverify.vim")
+ call assert_match('E81: Using <SID> not in a', readfile('Xtest.out')[0])
+ call delete('Xtest.out')
+ call delete('Xverify.vim')
+
" cleanup
set opfunc&
delfunc OpFunc1