diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-11-24 18:48:14 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-11-24 18:48:14 +0100 |
commit | 0f6562e9036f889185dff49a75c7fc5ffb28b307 (patch) | |
tree | 3fec0e8c765e63d940eb324be8322517c66acd8a /src/testdir | |
parent | 2a1b474fd82aff922f18570593972b12feaa2073 (diff) | |
download | vim-git-0f6562e9036f889185dff49a75c7fc5ffb28b307.tar.gz |
patch 7.4.941v7.4.941
Problem: There is no way to ignore case only for tag searches.
Solution: Add the 'tagcase' option. (Gary Johnson)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/Make_amiga.mak | 2 | ||||
-rw-r--r-- | src/testdir/Make_dos.mak | 1 | ||||
-rw-r--r-- | src/testdir/Make_ming.mak | 1 | ||||
-rw-r--r-- | src/testdir/Make_os2.mak | 1 | ||||
-rw-r--r-- | src/testdir/Make_vms.mms | 1 | ||||
-rw-r--r-- | src/testdir/Makefile | 1 | ||||
-rw-r--r-- | src/testdir/test_tagcase.in | 55 | ||||
-rw-r--r-- | src/testdir/test_tagcase.ok | 76 |
8 files changed, 138 insertions, 0 deletions
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak index af27919e8..1d7b07cfd 100644 --- a/src/testdir/Make_amiga.mak +++ b/src/testdir/Make_amiga.mak @@ -66,6 +66,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test_search_mbyte.out \ test_set.out \ test_signs.out \ + test_tagcase.out \ test_textobjects.out \ test_utf8.out @@ -221,5 +222,6 @@ test_ruby.out: test_ruby.in test_search_mbyte.out: test_search_mbyte.in test_set.out: test_set.in test_signs.out: test_signs.in +test_tagcase.out: test_tagcase.in test_textobjects.out: test_textobjects.in test_utf8.out: test_utf8.in diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index abef95046..30325ea11 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -65,6 +65,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test_search_mbyte.out \ test_set.out \ test_signs.out \ + test_tagcase.out \ test_textobjects.out \ test_utf8.out diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak index aa59a014e..a32f3edc4 100644 --- a/src/testdir/Make_ming.mak +++ b/src/testdir/Make_ming.mak @@ -87,6 +87,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test_search_mbyte.out \ test_set.out \ test_signs.out \ + test_tagcase.out \ test_textobjects.out \ test_utf8.out diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak index 9150af714..d593bb2cb 100644 --- a/src/testdir/Make_os2.mak +++ b/src/testdir/Make_os2.mak @@ -67,6 +67,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test_search_mbyte.out \ test_set.out \ test_signs.out \ + test_tagcase.out \ test_textobjects.out \ test_utf8.out diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms index a716d0361..0fd26c1fb 100644 --- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -126,6 +126,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \ test_search_mbyte.out \ test_set.out \ test_signs.out \ + test_tagcase.out \ test_textobjects.out \ test_utf8.out diff --git a/src/testdir/Makefile b/src/testdir/Makefile index 39d8388ec..d46718fa0 100644 --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -63,6 +63,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \ test_search_mbyte.out \ test_set.out \ test_signs.out \ + test_tagcase.out \ test_textobjects.out \ test_utf8.out diff --git a/src/testdir/test_tagcase.in b/src/testdir/test_tagcase.in new file mode 100644 index 000000000..322d7696a --- /dev/null +++ b/src/testdir/test_tagcase.in @@ -0,0 +1,55 @@ +Tests for 'tagcase' option + +STARTTEST +:/^start text$/+1,/^end text$/w! Xtext +:/^start tags$/+1,/^end tags$/-1w! Xtags +:set tags=Xtags +:e Xtext +:" +:" Verify default values. +:set ic& | setg tc& | setl tc& +:call append('$', "ic=".&ic." g:tc=".&g:tc." l:tc=".&l:tc." tc=".&tc) +:" +:" Verify that the local setting accepts <empty> but that the global setting +:" does not. The first of these (setting the local value to <empty>) should +:" succeed; the other two should fail. +:let v:errmsg = "" +:setl tc= +:call append('$', v:errmsg) +:let v:errmsg = "" +:setg tc= +:call append('$', v:errmsg) +:let v:errmsg = "" +:set tc= +:call append('$', v:errmsg) +:" +:" Verify that the correct number of matching tags is found for all values of +:" 'ignorecase' and global and local values 'tagcase', in all combinations. +:for &ic in [0, 1] +: for &g:tc in ["followic", "ignore", "match"] +: for &l:tc in ["", "followic", "ignore", "match"] +: call append('$', "ic=".&ic." g:tc=".&g:tc." l:tc=".&l:tc." tc=".&tc) +: call append('$', len(taglist("^foo$"))) +: call append('$', len(taglist("^Foo$"))) +: endfor +: endfor +:endfor +:" +:1,/^end text$/d +:w! test.out +:qa! +ENDTEST + +start text + +Foo +Bar +foo + +end text + +start tags +Bar Xtext 3 +Foo Xtext 2 +foo Xtext 4 +end tags diff --git a/src/testdir/test_tagcase.ok b/src/testdir/test_tagcase.ok new file mode 100644 index 000000000..fe161cf38 --- /dev/null +++ b/src/testdir/test_tagcase.ok @@ -0,0 +1,76 @@ +ic=0 g:tc=followic l:tc=followic tc=followic + +E474: Invalid argument: tc= +E474: Invalid argument: tc= +ic=0 g:tc=followic l:tc= tc=followic +1 +1 +ic=0 g:tc=followic l:tc=followic tc=followic +1 +1 +ic=0 g:tc=followic l:tc=ignore tc=ignore +2 +2 +ic=0 g:tc=followic l:tc=match tc=match +1 +1 +ic=0 g:tc=ignore l:tc= tc=ignore +2 +2 +ic=0 g:tc=ignore l:tc=followic tc=followic +1 +1 +ic=0 g:tc=ignore l:tc=ignore tc=ignore +2 +2 +ic=0 g:tc=ignore l:tc=match tc=match +1 +1 +ic=0 g:tc=match l:tc= tc=match +1 +1 +ic=0 g:tc=match l:tc=followic tc=followic +1 +1 +ic=0 g:tc=match l:tc=ignore tc=ignore +2 +2 +ic=0 g:tc=match l:tc=match tc=match +1 +1 +ic=1 g:tc=followic l:tc= tc=followic +2 +2 +ic=1 g:tc=followic l:tc=followic tc=followic +2 +2 +ic=1 g:tc=followic l:tc=ignore tc=ignore +2 +2 +ic=1 g:tc=followic l:tc=match tc=match +1 +1 +ic=1 g:tc=ignore l:tc= tc=ignore +2 +2 +ic=1 g:tc=ignore l:tc=followic tc=followic +2 +2 +ic=1 g:tc=ignore l:tc=ignore tc=ignore +2 +2 +ic=1 g:tc=ignore l:tc=match tc=match +1 +1 +ic=1 g:tc=match l:tc= tc=match +1 +1 +ic=1 g:tc=match l:tc=followic tc=followic +2 +2 +ic=1 g:tc=match l:tc=ignore tc=ignore +2 +2 +ic=1 g:tc=match l:tc=match tc=match +1 +1 |