summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/Make_amiga.mak2
-rw-r--r--src/testdir/Make_dos.mak2
-rw-r--r--src/testdir/Make_os2.mak2
-rw-r--r--src/testdir/Make_vms.mms2
-rw-r--r--src/testdir/Makefile2
-rw-r--r--src/testdir/test60.in71
-rw-r--r--src/testdir/test60.ok16
7 files changed, 92 insertions, 5 deletions
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index e9e75e517..aee0894fc 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -24,7 +24,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test38.out test39.out test40.out test41.out test42.out \
test43.out test44.out test45.out test46.out test47.out \
test48.out test51.out test53.out test54.out test55.out \
- test56.out test57.out test58.out test59.out
+ test56.out test57.out test58.out test59.out test60.out
.SUFFIXES: .in .out
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index 092b24aac..1821cca4c 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -25,7 +25,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test15.out test17.out test18.out test21.out test26.out \
test30.out test31.out test32.out test33.out test34.out \
test37.out test38.out test39.out test40.out test41.out \
- test42.out test52.out
+ test42.out test52.out test60.out
SCRIPTS32 = test50.out
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index 5236922c5..d8b2f7507 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -24,7 +24,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test38.out test39.out test40.out test41.out test42.out \
test43.out test44.out test45.out test46.out test47.out \
test48.out test51.out test53.out test54.out test55.out \
- test56.out test57.out test58.out test59.out
+ test56.out test57.out test58.out test59.out test60.out
.SUFFIXES: .in .out
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 6d08e5041..767ab7840 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -58,7 +58,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
test38.out test39.out test40.out test41.out test42.out \
test43.out test44.out test45.out test46.out \
test48.out test51.out test53.out test54.out test55.out \
- test56.out test57.out test58.out test59.out
+ test56.out test57.out test58.out test59.out test60.out
.IFDEF WANT_GUI
SCRIPT_GUI = test16.out
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 06c417357..49f14f9f9 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -15,7 +15,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test43.out test44.out test45.out test46.out test47.out \
test48.out test49.out test51.out test52.out test53.out \
test54.out test55.out test56.out test57.out test58.out \
- test59.out
+ test59.out test60.out
SCRIPTS_GUI = test16.out
diff --git a/src/testdir/test60.in b/src/testdir/test60.in
new file mode 100644
index 000000000..58a2c9083
--- /dev/null
+++ b/src/testdir/test60.in
@@ -0,0 +1,71 @@
+Tests for the exists() function. vim: set ft=vim :
+
+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'
+ augroup END
+ redir! > test.out
+
+ " valid autocmd group
+ call RunTest('#myagroup', 1)
+
+ " Valid autocmd group and event
+ call RunTest('#myagroup#BufEnter', 1)
+
+ " Valid autocmd group, event and pattern
+ call RunTest('#myagroup#BufEnter#*.my', 1)
+
+ " Valid autocmd event
+ call RunTest('#BufEnter', 1)
+
+ " Valid autocmd event and pattern
+ call RunTest('#BufEnter#*.my', 1)
+
+ " Non-existing autocmd group or event
+ call RunTest('#xyzagroup', 0)
+
+ " Non-existing autocmd group and valid autocmd event
+ call RunTest('#xyzagroup#BufEnter', 0)
+
+ " Valid autocmd group and autocmd event with no matching pattern
+ call RunTest('#myagroup#CmdwinEnter', 0)
+
+ " Valid autocmd group and non-existing autocmd event
+ call RunTest('#myagroup#xyzacmd', 0)
+
+ " Valid autocmd group and event and non-matching pattern
+ call RunTest('#myagroup#BufEnter#xyzpat', 0)
+
+ " Valid autocmd event and non-matching pattern
+ call RunTest('#BufEnter#xyzpat', 0)
+
+ " Empty autocmd group, event and pattern
+ call RunTest('###', 0)
+
+ " Empty autocmd group and event or event and pattern
+ call RunTest('##', 0)
+
+ " Testing support for event name that exists.
+ call RunTest('##SwapExists', 1)
+
+ " Testing support for event name that doesn't exist.
+ call RunTest('##SwapNotExists', 0)
+
+ redir END
+endfunction
+:call TestExists()
+:edit! test.out
+:set ff=unix
+:w
+:qa!
+ENDTEST
+
diff --git a/src/testdir/test60.ok b/src/testdir/test60.ok
new file mode 100644
index 000000000..004245ff6
--- /dev/null
+++ b/src/testdir/test60.ok
@@ -0,0 +1,16 @@
+
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK