aboutsummaryrefslogtreecommitdiff
path: root/src/testdir/test60.vim
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-01-31 10:39:15 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-01-31 10:39:15 -0300
commit72cf89bce8e4230dbc161dc5606f48ef9884ba70 (patch)
tree3ee06dbd8c57e291a8713289670ae1cb51397d44 /src/testdir/test60.vim
downloadrneovim-72cf89bce8e4230dbc161dc5606f48ef9884ba70.tar.gz
rneovim-72cf89bce8e4230dbc161dc5606f48ef9884ba70.tar.bz2
rneovim-72cf89bce8e4230dbc161dc5606f48ef9884ba70.zip
Import vim from changeset v5628:c9cad40b4181
- Cleanup source tree, leaving only files necessary for compilation/testing - Process files through unifdef to remove tons of FEAT_* macros - Process files through uncrustify to normalize source code formatting. - Port the build system to cmake
Diffstat (limited to 'src/testdir/test60.vim')
-rw-r--r--src/testdir/test60.vim98
1 files changed, 98 insertions, 0 deletions
diff --git a/src/testdir/test60.vim b/src/testdir/test60.vim
new file mode 100644
index 0000000000..f1157f73f9
--- /dev/null
+++ b/src/testdir/test60.vim
@@ -0,0 +1,98 @@
+" Vim script for exists() function test
+" Script-local variables are checked here
+
+" Existing script-local variable
+let s:script_var = 1
+echo 's:script_var: 1'
+if exists('s:script_var')
+ echo "OK"
+else
+ echo "FAILED"
+endif
+
+" Non-existing script-local variable
+unlet s:script_var
+echo 's:script_var: 0'
+if !exists('s:script_var')
+ echo "OK"
+else
+ echo "FAILED"
+endif
+
+" Existing script-local list
+let s:script_list = ["blue", "orange"]
+echo 's:script_list: 1'
+if exists('s:script_list')
+ echo "OK"
+else
+ echo "FAILED"
+endif
+
+" Non-existing script-local list
+unlet s:script_list
+echo 's:script_list: 0'
+if !exists('s:script_list')
+ echo "OK"
+else
+ echo "FAILED"
+endif
+
+" Existing script-local dictionary
+let s:script_dict = {"xcord":100, "ycord":2}
+echo 's:script_dict: 1'
+if exists('s:script_dict')
+ echo "OK"
+else
+ echo "FAILED"
+endif
+
+" Non-existing script-local dictionary
+unlet s:script_dict
+echo 's:script_dict: 0'
+if !exists('s:script_dict')
+ echo "OK"
+else
+ echo "FAILED"
+endif
+
+" Existing script curly-brace variable
+let str = "script"
+let s:curly_{str}_var = 1
+echo 's:curly_' . str . '_var: 1'
+if exists('s:curly_{str}_var')
+ echo "OK"
+else
+ echo "FAILED"
+endif
+
+" Non-existing script-local curly-brace variable
+unlet s:curly_{str}_var
+echo 's:curly_' . str . '_var: 0'
+if !exists('s:curly_{str}_var')
+ echo "OK"
+else
+ echo "FAILED"
+endif
+
+" Existing script-local function
+function! s:my_script_func()
+endfunction
+
+echo '*s:my_script_func: 1'
+if exists('*s:my_script_func')
+ echo "OK"
+else
+ echo "FAILED"
+endif
+
+" Non-existing script-local function
+delfunction s:my_script_func
+
+echo '*s:my_script_func: 0'
+if !exists('*s:my_script_func')
+ echo "OK"
+else
+ echo "FAILED"
+endif
+unlet str
+