summaryrefslogtreecommitdiff
path: root/src/testdir/test_tagcase.in
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-11-24 18:48:14 +0100
committerBram Moolenaar <Bram@vim.org>2015-11-24 18:48:14 +0100
commit0f6562e9036f889185dff49a75c7fc5ffb28b307 (patch)
tree3fec0e8c765e63d940eb324be8322517c66acd8a /src/testdir/test_tagcase.in
parent2a1b474fd82aff922f18570593972b12feaa2073 (diff)
downloadvim-0f6562e9036f889185dff49a75c7fc5ffb28b307.zip
patch 7.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/test_tagcase.in')
-rw-r--r--src/testdir/test_tagcase.in55
1 files changed, 55 insertions, 0 deletions
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