aboutsummaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorMarco Hinz <mh.codebro@gmail.com>2014-04-29 16:55:27 +0200
committerThiago de Arruda <tpadilha84@gmail.com>2014-04-29 15:14:25 -0300
commit046debb9359c85e2f2bc5c6d9481dac0025c6a80 (patch)
tree32dd1a0846edcbbb8a8ba005dce023577f6b17e8 /src/testdir
parentf30a83f10120320ea7c2aa1d480fcdb673aa0323 (diff)
downloadrneovim-046debb9359c85e2f2bc5c6d9481dac0025c6a80.tar.gz
rneovim-046debb9359c85e2f2bc5c6d9481dac0025c6a80.tar.bz2
rneovim-046debb9359c85e2f2bc5c6d9481dac0025c6a80.zip
vim-patch:7.4.268
Problem: Using exists() on a funcref for a script-local function does not work. Solution: Translate <SNR> to the special byte sequence. Add a test. https://code.google.com/p/vim/source/detail?r=1a5ed2626b26a982e307a206572121a557adf709
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_eval.in5
-rw-r--r--src/testdir/test_eval.ok4
-rw-r--r--src/testdir/test_eval_func.vim12
3 files changed, 20 insertions, 1 deletions
diff --git a/src/testdir/test_eval.in b/src/testdir/test_eval.in
index 3ab85301cf..09932261af 100644
--- a/src/testdir/test_eval.in
+++ b/src/testdir/test_eval.in
@@ -36,7 +36,10 @@ STARTTEST
:echo g:Foo(2)
:echo Foo(3)
-:$-5,$w! test.out
+:" script-local function used in Funcref must exist.
+:so test_eval_func.vim
+
+:$-9,$w! test.out
:q!
ENDTEST
diff --git a/src/testdir/test_eval.ok b/src/testdir/test_eval.ok
index c8f6dc7591..c7620836f7 100644
--- a/src/testdir/test_eval.ok
+++ b/src/testdir/test_eval.ok
@@ -4,3 +4,7 @@ Vim(function):E128: Function name must start with a capital or "s:": b:test()
called Foo(1)
called Foo(2)
called Foo(3)
+s:Testje exists: 0
+func s:Testje exists: 1
+Bar exists: 1
+func Bar exists: 1
diff --git a/src/testdir/test_eval_func.vim b/src/testdir/test_eval_func.vim
new file mode 100644
index 0000000000..48d01df27d
--- /dev/null
+++ b/src/testdir/test_eval_func.vim
@@ -0,0 +1,12 @@
+" Vim script used in test_eval.in. Needed for script-local function.
+
+func! s:Testje()
+ return "foo"
+endfunc
+
+let Bar = function('s:Testje')
+
+$put ='s:Testje exists: ' . exists('s:Testje')
+$put ='func s:Testje exists: ' . exists('*s:Testje')
+$put ='Bar exists: ' . exists('Bar')
+$put ='func Bar exists: ' . exists('*Bar')