summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-10-12 21:29:22 +0200
committerBram Moolenaar <Bram@vim.org>2017-10-12 21:29:22 +0200
commit4a6fcf8047de13c7949ab2f27f7774acaec4ae4d (patch)
treec408cb0119bffbc2028c9a026eddbf5aa1212913
parent9202162c5c069c925b6b9bf84e546fbd362cdf46 (diff)
patch 8.0.1186: still quite a few old style testsv8.0.1186
Problem: Still quite a few old style tests. Solution: Convert old to new style tests. (Yegappan Lakshmanan) Avoid ringing the bell while running tests.
-rw-r--r--src/Makefile10
-rw-r--r--src/testdir/Make_all.mak10
-rw-r--r--src/testdir/Make_ming.mak2
-rw-r--r--src/testdir/Make_vms.mms10
-rw-r--r--src/testdir/main.aap6
-rw-r--r--src/testdir/runtest.vim3
-rw-r--r--src/testdir/test31.in95
-rw-r--r--src/testdir/test31.ok14
-rw-r--r--src/testdir/test4.in34
-rw-r--r--src/testdir/test4.ok20
-rw-r--r--src/testdir/test5.in29
-rw-r--r--src/testdir/test5.ok9
-rw-r--r--src/testdir/test60.in601
-rw-r--r--src/testdir/test60.ok206
-rw-r--r--src/testdir/test60.vim98
-rw-r--r--src/testdir/test7.in26
-rw-r--r--src/testdir/test7.ok12
-rw-r--r--src/testdir/test78.in46
-rw-r--r--src/testdir/test78.ok3
-rw-r--r--src/testdir/test_autocmd.vim133
-rw-r--r--src/testdir/test_exists.vim321
-rw-r--r--src/testdir/test_recover.vim46
-rw-r--r--src/testdir/test_winbuf_close.vim124
-rw-r--r--src/version.c2
24 files changed, 643 insertions, 1217 deletions
diff --git a/src/Makefile b/src/Makefile
index 06204bddb0..7752fa17ed 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -2100,14 +2100,14 @@ test1 \
test_listchars \
test_search_mbyte \
test_wordcount \
- test3 test4 test5 test7 test8 \
+ test3 test8 \
test11 test12 test14 test15 test17 test19 \
test20 test25 test28 test29 \
- test30 test31 test32 test34 test36 test37 test38 test39 \
+ test30 test32 test34 test36 test37 test38 test39 \
test40 test42 test44 test45 test48 test49 \
test50 test52 test54 test55 test59 \
- test60 test64 test66 test68 test69 \
- test70 test72 test73 test77 test78 test79 \
+ test64 test66 test68 test69 \
+ test70 test72 test73 test77 test79 \
test83 test85 test86 test87 test88 \
test94 test95 test99 \
test108:
@@ -2149,6 +2149,7 @@ test_arglist \
test_ex_z \
test_exec_while_if \
test_execute_func \
+ test_exists \
test_exists_autocmd \
test_expand \
test_expand_dllpath \
@@ -2279,6 +2280,7 @@ test_arglist \
test_virtualedit \
test_visual \
test_winbar \
+ test_winbuf_close \
test_window_cmd \
test_window_id \
test_windows_home \
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak
index e27ee93466..eb13761d22 100644
--- a/src/testdir/Make_all.mak
+++ b/src/testdir/Make_all.mak
@@ -14,9 +14,6 @@ SCRIPTS_FIRST = \
# Tests that run on all systems.
SCRIPTS_ALL = \
test3.out \
- test4.out \
- test5.out \
- test7.out \
test8.out \
test14.out \
test15.out \
@@ -24,7 +21,6 @@ SCRIPTS_ALL = \
test20.out \
test28.out \
test29.out \
- test31.out \
test34.out \
test36.out \
test37.out \
@@ -36,7 +32,6 @@ SCRIPTS_ALL = \
test45.out \
test48.out \
test55.out \
- test60.out \
test64.out \
test66.out \
test68.out \
@@ -89,7 +84,6 @@ SCRIPTS_MORE4 = \
test32.out \
test59.out \
test72.out \
- test78.out \
test83.out
@@ -125,6 +119,7 @@ NEW_TESTS = test_arabic.res \
test_digraph.res \
test_display.res \
test_edit.res \
+ test_exists.res \
test_farsi.res \
test_file_size.res \
test_fnameescape.res \
@@ -196,6 +191,7 @@ NEW_TESTS = test_arabic.res \
test_vimscript.res \
test_visual.res \
test_winbar.res \
+ test_winbuf_close.res \
test_window_id.res \
test_windows_home.res \
test_writefile.res \
@@ -207,6 +203,4 @@ NEW_TESTS = test_arabic.res \
# Explicit dependencies.
test49.out: test49.vim
-test60.out: test60.vim
-
test_options.res test_alot.res: opt_test.vim
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index c5a5dc01df..ecfa97e4c7 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -68,7 +68,7 @@ win32: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_WIN32) newtests
fixff:
-$(VIMPROG) -u dos.vim $(NO_INITS) "+argdo set ff=dos|upd" +q *.in *.ok
-$(VIMPROG) -u dos.vim $(NO_INITS) "+argdo set ff=unix|upd" +q \
- dotest.in test60.ok test_listchars.ok \
+ dotest.in test_listchars.ok \
test_wordcount.ok
clean:
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 5d7770d330..efed68f9ca 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -73,20 +73,20 @@ VIMPROG = <->vim.exe
.SUFFIXES : .out .in
-SCRIPT = test1.out test3.out test4.out test5.out \
- test7.out test8.out \
+SCRIPT = test1.out test3.out \
+ test8.out \
test14.out test15.out \
test19.out test20.out \
- test28.out test29.out test30.out test31.out test32.out \
+ test28.out test29.out test30.out test32.out \
test34.out test36.out test37.out \
test38.out test39.out test40.out test42.out \
test44.out test45.out \
test48.out test49.out test54.out \
- test55.out test60.out \
+ test55.out \
test64.out \
test66.out test68.out test69.out \
test72.out \
- test77a.out test78.out test79.out \
+ test77a.out test79.out \
test88.out \
test94.out \
test95.out test99.out \
diff --git a/src/testdir/main.aap b/src/testdir/main.aap
index eb80a81f0d..54f7eb2565 100644
--- a/src/testdir/main.aap
+++ b/src/testdir/main.aap
@@ -4,12 +4,12 @@
VimProg ?= ../vim
-Scripts = test1.out test2.out test3.out test4.out test5.out test6.out
- test7.out test8.out test11.out
+Scripts = test1.out test2.out test3.out test6.out
+ test8.out test11.out
test12.out test13.out test14.out test15.out test17.out
test18.out test19.out test20.out test21.out
test25.out test27.out
- test28.out test29.out test30.out test31.out test32.out
+ test28.out test29.out test30.out test32.out
test34.out test36.out test37.out
test38.out test39.out test40.out test42.out
test44.out test45.out test46.out test47.out
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index d07710afce..245b51c64f 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -250,6 +250,9 @@ endif
" Execute the tests in alphabetical order.
for s:test in sort(s:tests)
+ " Silence, please!
+ set belloff=all
+
call RunTheTest(s:test)
if len(v:errors) > 0 && index(s:flaky, s:test) >= 0
diff --git a/src/testdir/test31.in b/src/testdir/test31.in
deleted file mode 100644
index ff5a4992ba..0000000000
--- a/src/testdir/test31.in
+++ /dev/null
@@ -1,95 +0,0 @@
-Test for commands that close windows and/or buffers:
-:quit
-:close
-:hide
-:only
-:sall
-:all
-:ball
-:buf
-:edit
-
-STARTTEST
-:so small.vim
-GA 1:$w! Xtest1
-$r2:$w! Xtest2
-$r3:$w! Xtest3
-:n! Xtest1 Xtest2
-A 1:set hidden
-:" test for working :n when hidden set; write "testtext 2"
-:n
-:w! test.out
-:" test for failing :rew when hidden not set; write "testtext 2 2"
-:set nohidden
-A 2:rew
-:w >>test.out
-:" test for working :rew when hidden set; write "testtext 1 1"
-:set hidden
-:rew
-:w >>test.out
-:" test for :all keeping a buffer when it's modified; write "testtext 1 1 1"
-:set nohidden
-A 1:sp
-:n Xtest2 Xtest3
-:all
-:1wincmd w
-:w >>test.out
-:" test abandoning changed buffer, should be unloaded even when 'hidden' set
-:" write "testtext 2 2" twice
-:set hidden
-A 1:q!
-:w >>test.out
-:unhide
-:w >>test.out
-:" test ":hide" hides anyway when 'hidden' not set; write "testtext 3"
-:set nohidden
-A 2:hide
-:w >>test.out
-:" test ":edit" failing in modified buffer when 'hidden' not set
-:" write "testtext 3 3"
-A 3:e Xtest1
-:w >>test.out
-:" test ":edit" working in modified buffer when 'hidden' set; write "testtext 1"
-:set hidden
-:e Xtest1
-:w >>test.out
-:" test ":close" not hiding when 'hidden' not set in modified buffer;
-:" write "testtext 3 3 3"
-:sp Xtest3
-:set nohidden
-A 3:close
-:w >>test.out
-:" test ":close!" does hide when 'hidden' not set in modified buffer;
-:" write "testtext 1"
-A 3:close!
-:w >>test.out
-:set nohidden
-:" test ":all!" hides changed buffer; write "testtext 2 2 2"
-:sp Xtest4
-GA 4:all!
-:1wincmd w
-:w >>test.out
-:"
-:" test ":q!" and hidden buffer.
-:bw! Xtest1 Xtest2 Xtest3 Xtest4
-:sp Xtest1
-:wincmd w
-:bw!
-:set modified
-:bot sp Xtest2
-:set modified
-:bot sp Xtest3
-:set modified
-:wincmd t
-:hide
-:q!
-:w >>test.out
-:q!
-:w >>test.out
-:q!
-:call append(line('$'), "Oh, Not finished yet.")
-:w >>test.out
-:qa!
-ENDTEST
-
-testtext
diff --git a/src/testdir/test31.ok b/src/testdir/test31.ok
deleted file mode 100644
index 39531974c6..0000000000
--- a/src/testdir/test31.ok
+++ /dev/null
@@ -1,14 +0,0 @@
-testtext 2
-testtext 2 2
-testtext 1 1
-testtext 1 1 1
-testtext 2 2
-testtext 2 2
-testtext 3
-testtext 3 3
-testtext 1
-testtext 3 3 3
-testtext 1
-testtext 2 2 2
-testtext 3
-testtext 1
diff --git a/src/testdir/test4.in b/src/testdir/test4.in
deleted file mode 100644
index b3ee49baa4..0000000000
--- a/src/testdir/test4.in
+++ /dev/null
@@ -1,34 +0,0 @@
-Test for autocommand that changes current buffer on BufEnter event.
-Check if modelines are interpreted for the correct buffer.
-
-STARTTEST
-:so small.vim
-:set nocompatible viminfo+=nviminfo
-:au BufEnter Xxx brew
-/start of
-:.,/end of/w! Xxx " write test file Xxx
-:set ai modeline modelines=3
-:sp Xxx " split to Xxx, autocmd will do :brew
-G?this is a
-othis should be auto-indented
-: " Append text with autoindent to this file
-:au! BufEnter Xxx
-:buf Xxx " go to Xxx, no autocmd anymore
-G?this is a
-othis should be in column 1:wq " append text without autoindent to Xxx
-G:r Xxx " include Xxx in the current file
-:set fo+=r " issue #57 do not move cursor on <c-o> when autoindent is set
-Go# abcdef2hi
-d0o# abcdef2hid0:
-:?startstart?,$w! test.out
-:qa!
-ENDTEST
-
-startstart
-start of test file Xxx
-vim: set noai :
- this is a test
- this is a test
- this is a test
- this is a test
-end of test file Xxx
diff --git a/src/testdir/test4.ok b/src/testdir/test4.ok
deleted file mode 100644
index d032e4c319..0000000000
--- a/src/testdir/test4.ok
+++ /dev/null
@@ -1,20 +0,0 @@
-startstart
-start of test file Xxx
-vim: set noai :
- this is a test
- this is a test
- this is a test
- this is a test
- this should be auto-indented
-end of test file Xxx
-start of test file Xxx
-vim: set noai :
- this is a test
- this is a test
- this is a test
- this is a test
-this should be in column 1
-end of test file Xxx
-# abc
-def
-def
diff --git a/src/testdir/test5.in b/src/testdir/test5.in
deleted file mode 100644
index e19e20d59b..0000000000
--- a/src/testdir/test5.in
+++ /dev/null
@@ -1,29 +0,0 @@
-Test for autocommand that deletes the current buffer on BufLeave event.
-Also test deleting the last buffer, should give a new, empty buffer.
-
-STARTTEST
-:so small.vim
-:au BufLeave Xxx bwipe
-/start of
-:.,/end of/w! Xxx " write test file Xxx
-:sp Xxx " split to Xxx
-:bwipe " delete buffer Xxx, now we're back here
-G?this is a
-othis is some more text
-: " Append some text to this file
-:?start?,$w! test.out " Write current file contents
-:bwipe test.out " delete alternate buffer
-:au bufleave test5.in bwipe
-:bwipe! " delete current buffer, get an empty one
-ithis is another test line:w >>test.out
-: " append an extra line to the output file
-:qa!
-ENDTEST
-
-start of test file Xxx
-vim: set noai :
- this is a test
- this is a test
- this is a test
- this is a test
-end of test file Xxx
diff --git a/src/testdir/test5.ok b/src/testdir/test5.ok
deleted file mode 100644
index 6743060794..0000000000
--- a/src/testdir/test5.ok
+++ /dev/null
@@ -1,9 +0,0 @@
-start of test file Xxx
-vim: set noai :
- this is a test
- this is a test
- this is a test
- this is a test
-this is some more text
-end of test file Xxx
-this is another test line
diff --git a/src/testdir/test60.in b/src/testdir/test60.in
deleted file mode 100644
index d3b299beba..0000000000
--- a/src/testdir/test60.in
+++ /dev/null
@@ -1,601 +0,0 @@
-Tests for the exists() and has() functions. vim: set ft=vim ts=8 sw=2 :
-
-STARTTEST
-:so small.vim
-:function! RunTest(str, result)
- if exists(a:str) == a:result
- echo "OK"
- else
- echo "FAILED: Checking for " . a:str
- endif
-endfunction
-:function! TestExists()
- augroup myagroup
- autocmd! BufEnter *.my echo "myfile edited"
- autocmd! FuncUndefined UndefFun exec "fu UndefFun()\nendfu"
- augroup END
- set rtp+=./sautest
-
- let test_cases = []
-
- " 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
- let test_cases += [['#myagroup#BufEnter#*.my', 1]]
- " Valid autocmd event
- let test_cases += [['#BufEnter', 1]]
- " Valid autocmd event and pattern
- let test_cases += [['#BufEnter#*.my', 1]]
- " Non-existing autocmd group or event
- let test_cases += [['#xyzagroup', 0]]
- " Non-existing autocmd group and valid autocmd event
- let test_cases += [['#xyzagroup#BufEnter', 0]]
- " Valid autocmd group and event with no matching pattern
- let test_cases += [['#myagroup#CmdwinEnter', 0]]
- " Valid autocmd group and non-existing autocmd event
- let test_cases += [['#myagroup#xyzacmd', 0]]
- " Valid autocmd group and event and non-matching pattern
- let test_cases += [['#myagroup#BufEnter#xyzpat', 0]]
- " Valid autocmd event and non-matching pattern
- let test_cases += [['#BufEnter#xyzpat', 0]]
- " Empty autocmd group, event and pattern
- let test_cases += [['###', 0]]
- " Empty autocmd group and event or empty event and pattern
- let test_cases += [['##', 0]]
- " Valid autocmd event
- let test_cases += [['##FileReadCmd', 1]]
- " Non-existing autocmd event
- let test_cases += [['##MySpecialCmd', 0]]
-
- " Existing and working option (long form)
- 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
- 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)
- let test_cases += [['&nojs', 0]]
- " Non-existing option
- let test_cases += [['&myxyzoption', 0]]
-
- " 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.
- let test_cases += [['+autoprint', 0]]
-
- " Existing environment variable
- let $EDITOR_NAME = 'Vim Editor'
- let test_cases += [['$EDITOR_NAME', 1]]
- " Non-existing environment variable
- let test_cases += [['$NON_ENV_VAR', 0]]
-
- " 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]]
- " Non-existing user defined function
- let test_cases += [['*MyxyzFunc', 0]]
-
- " Function that may be created by FuncUndefined event
- let test_cases += [['*UndefFun', 0]]
- " Function that may be created by script autoloading
- let test_cases += [['*footest#F', 0]]
-
- redir! > test.out
-
- for [test_case, result] in test_cases
- echo test_case . ": " . result
- call RunTest(test_case, result)
- endfor
-
- " Valid internal command (full match)
- echo ':edit: 2'
- if exists(':edit') == 2
- echo "OK"
- else
- 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
- echo "OK"
- else
- echo "FAILED"
- endif
-
- " Non-existing internal command
- echo ':invalidcmd: 0'
- if !exists(':invalidcmd')
- echo "OK"
- else
- echo "FAILED"
- endif
-
- " User defined command (full match)
- command! MyCmd :echo 'My command'
- echo ':MyCmd: 2'
- if exists(':MyCmd') == 2
- echo "OK"
- else
- echo "FAILED"
- endif
-
- " User defined command (partial match)
- command! MyOtherCmd :echo 'Another command'
- echo ':My: 3'
- if exists(':My') == 3
- echo "OK"
- else
- echo "FAILED"
- endif
-
- " Command modifier
- echo ':rightbelow: 2'
- if exists(':rightbelow') == 2
- echo "OK"
- else
- echo "FAILED"
- endif
-
- " Non-existing user defined command (full match)
- delcommand MyCmd
-
- echo ':MyCmd: 0'
- if !exists(':MyCmd')
- echo "OK"
- else
- echo "FAILED"
- endif
-
- " Non-existing user defined command (partial match)
- delcommand MyOtherCmd
-
- echo ':My: 0'
- if !exists(':My')
- echo "OK"
- else
- echo "FAILED"
- endif
-
- " Valid local variable
- let local_var = 1
- echo 'local_var: 1'
- if exists('local_var')
- echo "OK"
- else
- 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'
- if !exists('local_var')
- echo "OK"
- else
- echo "FAILED"
- endif
-
- " Non-existing autoload variable that may be autoloaded
- echo 'footest#x: 0'
- if !exists('footest#x')
- echo "OK"
- else
- echo "FAILED"
- endif
-
- " Valid local list
- let local_list = ["blue", "orange"]
- echo 'local_list: 1'
- if exists('local_list')
- echo "OK"
- else
- 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'
- if !exists('local_list')
- echo "OK"
- else
- echo "FAILED"
- endif
-
- " Valid local dictionary
- let local_dict = {"xcord":100, "ycord":2}
- echo 'local_dict: 1'
- if exists('local_dict')
- echo "OK"
- else
- echo "FAILED"
- endif
-
- " Non-existing local dictionary
- unlet local_dict
- echo 'local_dict: 0'
- if !exists('local_dict')
- echo "OK"
- else
- 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'
- if exists('g:global_var')
- echo "OK"
- else
- 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'
- if !exists('g:global_var')
- echo "OK"
- else
- echo "FAILED"
- endif
-
- " 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 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 str = "global"
- let g:curly_{str}_var = 1
- echo 'g:curly_' . str . '_var: 1'
- if exists('g:curly_{str}_var')
- echo "OK"
- else
- echo "FAILED"
- endif
-
- " Non-existing global curly-brace variable
- 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")
-
- echo ' g:footest#x =' g:footest#x
- echo ' footest#F()' footest#F()
- echo 'UndefFun()' UndefFun()
-
- redir END
-endfunction
-:call TestExists()
-:"
-:delfunc TestExists
-:delfunc RunTest
-:delfunc TestFuncArg
-:edit! test.out
-:set ff=unix
-:w
-:qa!
-:while getchar(1) | call getchar() | endwhile
-ENDTEST
-
diff --git a/src/testdir/test60.ok b/src/testdir/test60.ok
deleted file mode 100644
index 0c382ad281..0000000000
--- a/src/testdir/test60.ok
+++ /dev/null
@@ -1,206 +0,0 @@
-
-#myagroup: 1
-OK
-#myagroup+b: 0
-OK
-#myagroup#BufEnter: 1
-OK
-#myagroup#BufEnter#*.my: 1
-OK
-#BufEnter: 1
-OK
-#BufEnter#*.my: 1
-OK
-#xyzagroup: 0
-OK
-#xyzagroup#BufEnter: 0
-OK
-#myagroup#CmdwinEnter: 0
-OK
-#myagroup#xyzacmd: 0
-OK
-#myagroup#BufEnter#xyzpat: 0
-OK
-#BufEnter#xyzpat: 0
-OK
-###: 0
-