summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorDominique Pelle <dominique.pelle@gmail.com>2021-12-17 17:32:29 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-17 17:32:29 +0000
commit354b23a9f87fd8c5aec457d88320a0a5bce4b985 (patch)
tree7f6c83f3324e34ad812bb3dc34981e5ec3ceadfb /src/testdir
parentdb1a410b610b2c1941311acc57dcc4afec20720e (diff)
downloadvim-git-354b23a9f87fd8c5aec457d88320a0a5bce4b985.tar.gz
patch 8.2.3839: using \z() with \z1 not tested for syntax highlightingv8.2.3839
Problem: Using \z() with \z1 not tested for syntax highlighting. Solution: Add a test. (Dominique Pellé, closes #9365)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_syntax.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/testdir/test_syntax.vim b/src/testdir/test_syntax.vim
index 83a63c421..14ae4c575 100644
--- a/src/testdir/test_syntax.vim
+++ b/src/testdir/test_syntax.vim
@@ -662,6 +662,24 @@ func Test_syntax_c()
call delete('Xtest.c')
endfun
+" Test \z(...) along with \z1
+func Test_syn_zsub()
+ new
+ syntax on
+ call setline(1, 'xxx start foo xxx not end foo xxx end foo xxx')
+ let l:expected = ' ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ '
+
+ for l:re in [0, 1, 2]
+ " Example taken from :help :syn-ext-match
+ syntax region Z start="start \z(\I\i*\)" skip="not end \z1" end="end \z1"
+ eval AssertHighlightGroups(1, 1, l:expected, 1, 'regexp=' .. l:re)
+ syntax clear Z
+ endfor
+
+ set re&
+ bw!
+endfunc
+
" Using \z() in a region with NFA failing should not crash.
func Test_syn_wrong_z_one()
new