summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-04-09 15:41:31 +0200
committerBram Moolenaar <Bram@vim.org>2017-04-09 15:41:31 +0200
commitf8ec998613d8037e345f4e7e08460dfc15c528a9 (patch)
tree7ecef4c27c02a8faf05ceae24e98274dbf9b1055
parent59053e1d9f41f9afa16ac7e266ee825a2eb2dd59 (diff)
downloadvim-git-f8ec998613d8037e345f4e7e08460dfc15c528a9.tar.gz
patch 8.0.0558: :ownsyntax is not testedv8.0.0558
Problem: The :ownsyntax command is not tested. Solution: Add a test. (Dominique Pelle, closes #1622)
-rw-r--r--src/testdir/test_syntax.vim29
-rw-r--r--src/version.c2
2 files changed, 31 insertions, 0 deletions
diff --git a/src/testdir/test_syntax.vim b/src/testdir/test_syntax.vim
index 9ebe3f13e..d4bb25e69 100644
--- a/src/testdir/test_syntax.vim
+++ b/src/testdir/test_syntax.vim
@@ -349,3 +349,32 @@ func Test_invalid_name()
hi clear Nop
hi clear @Wrong
endfunc
+
+func Test_ownsyntax()
+ new Xfoo
+ call setline(1, '#define FOO')
+ syntax on
+ set filetype=c
+ ownsyntax perl
+ call assert_equal('perlComment', synIDattr(synID(line('.'), col('.'), 1), 'name'))
+ call assert_equal('c', b:current_syntax)
+ call assert_equal('perl', w:current_syntax)
+
+ " A new split window should have the original syntax.
+ split
+ call assert_equal('cDefine', synIDattr(synID(line('.'), col('.'), 1), 'name'))
+ call assert_equal('c', b:current_syntax)
+ call assert_equal(0, exists('w:current_syntax'))
+
+ wincmd x
+ call assert_equal('perlComment', synIDattr(synID(line("."), col("."), 1), "name"))
+
+ syntax off
+ set filetype&
+ %bw!
+endfunc
+
+func Test_ownsyntax_completion()
+ call feedkeys(":ownsyntax java\<C-A>\<C-B>\"\<CR>", 'tx')
+ call assert_equal('"ownsyntax java javacc javascript', @:)
+endfunc
diff --git a/src/version.c b/src/version.c
index d37033f4e..26df63410 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 558,
+/**/
557,
/**/
556,