aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_syntax.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-27 08:23:32 +0800
committerGitHub <noreply@github.com>2022-10-27 08:23:32 +0800
commit23204c83ed5333811192513ed9f61d70682fbee5 (patch)
tree85b80a2480c21f8bdb8f4354750cc7a665e9904a /src/nvim/testdir/test_syntax.vim
parentc86371258cb10a015cf151b84e04df4480569aff (diff)
parentc031547c8d39c5fc99c6f1fab31b50ba6fb32cbc (diff)
downloadrneovim-23204c83ed5333811192513ed9f61d70682fbee5.tar.gz
rneovim-23204c83ed5333811192513ed9f61d70682fbee5.tar.bz2
rneovim-23204c83ed5333811192513ed9f61d70682fbee5.zip
Merge pull request #20822 from zeertzjq/vim-8.2.2837
vim-patch:8.2.{2837,3839}: various tests
Diffstat (limited to 'src/nvim/testdir/test_syntax.vim')
-rw-r--r--src/nvim/testdir/test_syntax.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_syntax.vim b/src/nvim/testdir/test_syntax.vim
index 2a173916d0..d686ad7e96 100644
--- a/src/nvim/testdir/test_syntax.vim
+++ b/src/nvim/testdir/test_syntax.vim
@@ -113,6 +113,9 @@ func Test_syntime()
let a = execute('syntime report')
call assert_equal("\nNo Syntax items defined for this buffer", a)
+ let a = execute('syntime clear')
+ call assert_equal("\nNo Syntax items defined for this buffer", a)
+
view samples/memfile_test.c
setfiletype cpp
redraw
@@ -663,6 +666,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