diff options
| author | Bram Moolenaar <Bram@vim.org> | 2017-06-27 15:43:49 +0200 | 
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2017-06-27 15:43:49 +0200 | 
| commit | 0b2eef24bcbe2c85c90bbde914a1782cbedc5c72 (patch) | |
| tree | ca5bad4e11f7d26fba39fa2e25256aeb3edba98f /src | |
| parent | 18d90b95c49d9ff1c635dd762864022aab8e71f1 (diff) | |
| download | vim-git-0b2eef24bcbe2c85c90bbde914a1782cbedc5c72.tar.gz | |
patch 8.0.0682: no test for synIDtrans()v8.0.0682
Problem:    No test for synIDtrans().
Solution:   Add a test. (Dominique Pelle, closes #1796)
Diffstat (limited to 'src')
| -rw-r--r-- | src/testdir/test_syntax.vim | 27 | ||||
| -rw-r--r-- | src/version.c | 2 | 
2 files changed, 27 insertions, 2 deletions
diff --git a/src/testdir/test_syntax.vim b/src/testdir/test_syntax.vim index fef63418f..33d7203e3 100644 --- a/src/testdir/test_syntax.vim +++ b/src/testdir/test_syntax.vim @@ -418,7 +418,7 @@ func Test_bg_detection()    hi Normal ctermbg=15    call assert_equal('light', &bg) -  " manually-set &bg takes precendence over auto-detection +  " manually-set &bg takes precedence over auto-detection    set bg=light    hi Normal ctermbg=4    call assert_equal('light', &bg) @@ -461,7 +461,6 @@ func Test_syntax_hangs()    bwipe!  endfunc -  func Test_conceal()    if !has('conceal')      return @@ -497,3 +496,27 @@ func Test_conceal()    set conceallevel&    bw!  endfunc + +fun Test_synstack_synIDtrans() +  new +  setfiletype c +  syntax on +  call setline(1, ' /* A comment with a TODO */') + +  call assert_equal([], synstack(1, 1)) + +  norm f/ +  call assert_equal(['cComment', 'cCommentStart'], map(synstack(line("."), col(".")), 'synIDattr(v:val, "name")')) +  call assert_equal(['Comment', 'Comment'],        map(synstack(line("."), col(".")), 'synIDattr(synIDtrans(v:val), "name")')) + +  norm fA +  call assert_equal(['cComment'], map(synstack(line("."), col(".")), 'synIDattr(v:val, "name")')) +  call assert_equal(['Comment'],  map(synstack(line("."), col(".")), 'synIDattr(synIDtrans(v:val), "name")')) + +  norm fT +  call assert_equal(['cComment', 'cTodo'], map(synstack(line("."), col(".")), 'synIDattr(v:val, "name")')) +  call assert_equal(['Comment', 'Todo'],   map(synstack(line("."), col(".")), 'synIDattr(synIDtrans(v:val), "name")')) + +  syn clear +  bw! +endfunc diff --git a/src/version.c b/src/version.c index b06f9383f..c1d5ec841 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 */  /**/ +    682, +/**/      681,  /**/      680,  | 
