summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-05-05 21:15:17 +0000
committerBram Moolenaar <Bram@vim.org>2006-05-05 21:15:17 +0000
commit91170f8ae70cb9a2c15a5d89182f317c18aa0de7 (patch)
tree1633e86e6a00760931319093cec0ea7fc3709893 /src/testdir
parentf3a678875fd88038b18b83311075d1250d9d7ca5 (diff)
downloadvim-git-91170f8ae70cb9a2c15a5d89182f317c18aa0de7.tar.gz
updated for version 7.0g04
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test60.in59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/testdir/test60.in b/src/testdir/test60.in
index 2c414b38e..d5a0d7c28 100644
--- a/src/testdir/test60.in
+++ b/src/testdir/test60.in
@@ -18,6 +18,8 @@ endfunction
" valid autocmd group
let test_cases += [['#myagroup', 1]]
+ " valid autocmd group with garbage
+ let test_cases += [['#myagroup+b', 0]]
" Valid autocmd group and event
let test_cases += [['#myagroup#BufEnter', 1]]
" Valid autocmd group, event and pattern
@@ -51,6 +53,8 @@ endfunction
let test_cases += [['&textwidth', 1]]
" Existing and working option (short form)
let test_cases += [['&tw', 1]]
+ " Existing and working option with garbage
+ let test_cases += [['&tw-', 0]]
" Global option
let test_cases += [['&g:errorformat', 1]]
" Local option
@@ -64,6 +68,8 @@ endfunction
" Existing and working option (long form)
let test_cases += [['+incsearch', 1]]
+ " Existing and working option with garbage
+ let test_cases += [['+incsearch!1', 0]]
" Existing and working option (short form)
let test_cases += [['+is', 1]]
" Existing option that is hidden.
@@ -77,8 +83,12 @@ endfunction
" Valid internal function
let test_cases += [['*bufnr', 1]]
+ " Valid internal function with ()
+ let test_cases += [['*bufnr()', 1]]
" Non-existing internal function
let test_cases += [['*myxyzfunc', 0]]
+ " Valid internal function with garbage
+ let test_cases += [['*bufnr&6', 0]]
" Valid user defined function
let test_cases += [['*TestExists', 1]]
@@ -100,6 +110,14 @@ endfunction
echo "FAILED"
endif
+ " Valid internal command (full match) with garbage
+ echo ':edit/a: 0'
+ if exists(':edit/a') == 0
+ echo "OK"
+ else
+ echo "FAILED"
+ endif
+
" Valid internal command (partial match)
echo ':q: 1'
if exists(':q') == 1
@@ -171,6 +189,15 @@ endfunction
echo "FAILED"
endif
+ " Valid local variable with garbage
+ let local_var = 1
+ echo 'local_var%n: 0'
+ if !exists('local_var%n')
+ echo "OK"
+ else
+ echo "FAILED"
+ endif
+
" Non-existing local variable
unlet local_var
echo 'local_var: 0'
@@ -189,6 +216,30 @@ endfunction
echo "FAILED"
endif
+ " Valid local list item
+ echo 'local_list[1]: 1'
+ if exists('local_list[1]')
+ echo "OK"
+ else
+ echo "FAILED"
+ endif
+
+ " Valid local list item with garbage
+ echo 'local_list[1]+5: 0'
+ if !exists('local_list[1]+5')
+ echo "OK"
+ else
+ echo "FAILED"
+ endif
+
+ " Invalid local list item
+ echo 'local_list[2]: 0'
+ if !exists('local_list[2]')
+ echo "OK"
+ else
+ echo "FAILED"
+ endif
+
" Non-existing local list
unlet local_list
echo 'local_list: 0'
@@ -245,6 +296,14 @@ endfunction
echo "FAILED"
endif
+ " Existing global variable with garbage
+ echo 'g:global_var-n: 1'
+ if !exists('g:global_var-n')
+ echo "OK"
+ else
+ echo "FAILED"
+ endif
+
" Non-existing global variable
unlet g:global_var
echo 'g:global_var: 0'