0
0
mirror of https://github.com/vim/vim.git synced 2025-10-28 09:27:14 -04:00

updated for version 7.0179

This commit is contained in:
Bram Moolenaar
2006-01-12 23:22:24 +00:00
parent 1cbe5f739d
commit 4770d09abd
68 changed files with 5456 additions and 1904 deletions

View File

@@ -20,11 +20,11 @@ uk
wrong
-------
bad
['put', 'OK', 'uk']
['put', 'uk', 'OK']
inputs
['input', 'puts', 'outputs']
comment
['Comment']
['Comment', 'outtest', 'the end']
ok
['OK', 'uk', 'put']
Ok
@@ -34,7 +34,7 @@ test
d<EFBFBD><EFBFBD>l
['deol', 'd<><64>r', 'test']
end
['put', 'OK', 'test']
['put', 'uk', 'test']
the
['put', 'uk', 'test']
gebletegek
@@ -141,7 +141,7 @@ bad
wordutilize
['word utilize', 'wordutils', 'wordutil']
pro
['bork', 'end', 'word']
['bork', 'word', 'end']
borkborkborkborkborkbork
['bork borkborkborkborkbork', 'borkbork borkborkborkbork', 'borkborkbork borkborkbork']
tomatotomatotomato
@@ -185,7 +185,7 @@ probarbirk
middle
[]
startmiddle
['startmiddleend']
['startmiddleend', 'startmiddlebar']
middleend
[]
endstart
@@ -217,7 +217,7 @@ probarbirk
middle
[]
leadmiddle
['leadmiddleend']
['leadmiddleend', 'leadmiddlebar']
middleend
[]
endlead
@@ -249,7 +249,7 @@ probarmaat
middle
[]
leadmiddle
[]
['leadmiddlebar']
middletail
[]
taillead

View File

@@ -20,11 +20,11 @@ uk
wrong
-------
bad
['put', 'OK', 'uk']
['put', 'uk', 'OK']
inputs
['input', 'puts', 'outputs']
comment
['Comment']
['Comment', 'outtest', 'the end']
ok
['OK', 'uk', 'put']
Ok
@@ -34,7 +34,7 @@ test
déôl
['deol', 'déôr', 'test']
end
['put', 'OK', 'test']
['put', 'uk', 'test']
the
['put', 'uk', 'test']
gebletegek
@@ -141,7 +141,7 @@ bad
wordutilize
['word utilize', 'wordutils', 'wordutil']
pro
['bork', 'end', 'word']
['bork', 'word', 'end']
borkborkborkborkborkbork
['bork borkborkborkborkbork', 'borkbork borkborkborkbork', 'borkborkbork borkborkbork']
tomatotomatotomato
@@ -185,7 +185,7 @@ probarbirk
middle
[]
startmiddle
['startmiddleend']
['startmiddleend', 'startmiddlebar']
middleend
[]
endstart
@@ -217,7 +217,7 @@ probarbirk
middle
[]
leadmiddle
['leadmiddleend']
['leadmiddleend', 'leadmiddlebar']
middleend
[]
endlead
@@ -249,7 +249,7 @@ probarmaat
middle
[]
leadmiddle
[]
['leadmiddlebar']
middletail
[]
taillead

View File

@@ -51,6 +51,10 @@ endfunction
let test_cases += [['&textwidth', 1]]
" Existing and working option (short form)
let test_cases += [['&tw', 1]]
" Global option
let test_cases += [['&g:errorformat', 1]]
" Local option
let test_cases += [['&l:errorformat', 1]]
" Negative form of existing and working option (long form)
let test_cases += [['&nojoinspaces', 0]]
" Negative form of existing and working option (short form)
@@ -212,6 +216,26 @@ endfunction
echo "FAILED"
endif
" Existing local curly-brace variable
let str = "local"
let curly_{str}_var = 1
echo 'curly_' . str . '_var: 1'
if exists('curly_{str}_var')
echo "OK"
else
echo "FAILED"
endif
" Non-existing local curly-brace variable
unlet curly_{str}_var
echo 'curly_' . str . '_var: 0'
if !exists('curly_{str}_var')
echo "OK"
else
echo "FAILED"
endif
" Existing global variable
let g:global_var = 1
echo 'g:global_var: 1'
@@ -230,29 +254,46 @@ endfunction
echo "FAILED"
endif
" Existing local curly-brace variable
let curly_local_var = 1
let str = "local"
echo 'curly_{str}_var: 1'
if exists('curly_{str}_var')
" Existing global list
let g:global_list = ["blue", "orange"]
echo 'g:global_list: 1'
if exists('g:global_list')
echo "OK"
else
echo "FAILED"
endif
" Non-existing local curly-brace variable
unlet curly_local_var
echo 'curly_{str}_var: 0'
if !exists('curly_{str}_var')
" Non-existing global list
unlet g:global_list
echo 'g:global_list: 0'
if !exists('g:global_list')
echo "OK"
else
echo "FAILED"
endif
" Existing global dictionary
let g:global_dict = {"xcord":100, "ycord":2}
echo 'g:global_dict: 1'
if exists('g:global_dict')
echo "OK"
else
echo "FAILED"
endif
" Non-existing global dictionary
unlet g:global_dict
echo 'g:global_dict: 0'
if !exists('g:global_dict')
echo "OK"
else
echo "FAILED"
endif
" Existing global curly-brace variable
let g:curly_global_var = 1
let str = "global"
echo 'g:curly_{str}_var: 1'
let g:curly_{str}_var = 1
echo 'g:curly_' . str . '_var: 1'
if exists('g:curly_{str}_var')
echo "OK"
else
@@ -260,17 +301,212 @@ endfunction
endif
" Non-existing global curly-brace variable
unlet g:curly_global_var
echo 'g:curly_{str}_var: 0'
unlet g:curly_{str}_var
echo 'g:curly_' . str . '_var: 0'
if !exists('g:curly_{str}_var')
echo "OK"
else
echo "FAILED"
endif
" Existing window variable
echo 'w:window_var: 1'
let w:window_var = 1
if exists('w:window_var')
echo "OK"
else
echo "FAILED"
endif
" Non-existing window variable
unlet w:window_var
echo 'w:window_var: 0'
if !exists('w:window_var')
echo "OK"
else
echo "FAILED"
endif
" Existing window list
let w:window_list = ["blue", "orange"]
echo 'w:window_list: 1'
if exists('w:window_list')
echo "OK"
else
echo "FAILED"
endif
" Non-existing window list
unlet w:window_list
echo 'w:window_list: 0'
if !exists('w:window_list')
echo "OK"
else
echo "FAILED"
endif
" Existing window dictionary
let w:window_dict = {"xcord":100, "ycord":2}
echo 'w:window_dict: 1'
if exists('w:window_dict')
echo "OK"
else
echo "FAILED"
endif
" Non-existing window dictionary
unlet w:window_dict
echo 'w:window_dict: 0'
if !exists('w:window_dict')
echo "OK"
else
echo "FAILED"
endif
" Existing window curly-brace variable
let str = "window"
let w:curly_{str}_var = 1
echo 'w:curly_' . str . '_var: 1'
if exists('w:curly_{str}_var')
echo "OK"
else
echo "FAILED"
endif
" Non-existing window curly-brace variable
unlet w:curly_{str}_var
echo 'w:curly_' . str . '_var: 0'
if !exists('w:curly_{str}_var')
echo "OK"
else
echo "FAILED"
endif
" Existing buffer variable
echo 'b:buffer_var: 1'
let b:buffer_var = 1
if exists('b:buffer_var')
echo "OK"
else
echo "FAILED"
endif
" Non-existing buffer variable
unlet b:buffer_var
echo 'b:buffer_var: 0'
if !exists('b:buffer_var')
echo "OK"
else
echo "FAILED"
endif
" Existing buffer list
let b:buffer_list = ["blue", "orange"]
echo 'b:buffer_list: 1'
if exists('b:buffer_list')
echo "OK"
else
echo "FAILED"
endif
" Non-existing buffer list
unlet b:buffer_list
echo 'b:buffer_list: 0'
if !exists('b:buffer_list')
echo "OK"
else
echo "FAILED"
endif
" Existing buffer dictionary
let b:buffer_dict = {"xcord":100, "ycord":2}
echo 'b:buffer_dict: 1'
if exists('b:buffer_dict')
echo "OK"
else
echo "FAILED"
endif
" Non-existing buffer dictionary
unlet b:buffer_dict
echo 'b:buffer_dict: 0'
if !exists('b:buffer_dict')
echo "OK"
else
echo "FAILED"
endif
" Existing buffer curly-brace variable
let str = "buffer"
let b:curly_{str}_var = 1
echo 'b:curly_' . str . '_var: 1'
if exists('b:curly_{str}_var')
echo "OK"
else
echo "FAILED"
endif
" Non-existing buffer curly-brace variable
unlet b:curly_{str}_var
echo 'b:curly_' . str . '_var: 0'
if !exists('b:curly_{str}_var')
echo "OK"
else
echo "FAILED"
endif
" Script-local tests
source test60.vim
" Existing Vim internal variable
echo 'v:version: 1'
if exists('v:version')
echo "OK"
else
echo "FAILED"
endif
" Non-existing Vim internal variable
echo 'v:non_exists_var: 0'
if !exists('v:non_exists_var')
echo "OK"
else
echo "FAILED"
endif
" Function arguments
function TestFuncArg(func_arg, ...)
echo 'a:func_arg: 1'
if exists('a:func_arg')
echo "OK"
else
echo "FAILED"
endif
echo 'a:non_exists_arg: 0'
if !exists('a:non_exists_arg')
echo "OK"
else
echo "FAILED"
endif
echo 'a:1: 1'
if exists('a:1')
echo "OK"
else
echo "FAILED"
endif
echo 'a:2: 0'
if !exists('a:2')
echo "OK"
else
echo "FAILED"
endif
endfunction
call TestFuncArg("arg1", "arg2")
redir END
endfunction
:call TestExists()

View File

@@ -33,6 +33,10 @@ OK
OK
&tw: 1
OK
&g:errorformat: 1
OK
&l:errorformat: 1
OK
&nojoinspaces: 0
OK
&nojs: 0
@@ -85,27 +89,87 @@ local_dict: 1
OK
local_dict: 0
OK
curly_local_var: 1
OK
curly_local_var: 0
OK
g:global_var: 1
OK
g:global_var: 0
OK
curly_{str}_var: 1
g:global_list: 1
OK
curly_{str}_var: 0
g:global_list: 0
OK
g:curly_{str}_var: 1
g:global_dict: 1
OK
g:curly_{str}_var: 0
g:global_dict: 0
OK
g:curly_global_var: 1
OK
g:curly_global_var: 0
OK
w:window_var: 1
OK
w:window_var: 0
OK
w:window_list: 1
OK
w:window_list: 0
OK
w:window_dict: 1
OK
w:window_dict: 0
OK
w:curly_window_var: 1
OK
w:curly_window_var: 0
OK
b:buffer_var: 1
OK
b:buffer_var: 0
OK
b:buffer_list: 1
OK
b:buffer_list: 0
OK
b:buffer_dict: 1
OK
b:buffer_dict: 0
OK
b:curly_buffer_var: 1
OK
b:curly_buffer_var: 0
OK
s:script_var: 1
OK
s:script_var: 0
OK
s:curly_{str}_var: 1
s:script_list: 1
OK
s:curly_{str}_var: 0
s:script_list: 0
OK
s:script_dict: 1
OK
s:script_dict: 0
OK
s:curly_script_var: 1
OK
s:curly_script_var: 0
OK
*s:my_script_func: 1
OK
*s:my_script_func: 0
OK
v:version: 1
OK
v:non_exists_var: 0
OK
a:func_arg: 1
OK
a:non_exists_arg: 0
OK
a:1: 1
OK
a:2: 0
OK

97
src/testdir/test60.vim Normal file
View File

@@ -0,0 +1,97 @@
" 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