diff options
| author | Billy Su <g4691821@gmail.com> | 2019-03-02 12:38:36 +0800 |
|---|---|---|
| committer | Billy Su <g4691821@gmail.com> | 2019-03-07 23:48:53 +0800 |
| commit | fbd8209286373843b7e9b4151a1432fc4555484d (patch) | |
| tree | ed434d5f07975fe4bc4b52ba401254e55b7c523d /src/nvim/testdir | |
| parent | 570e41fc08ae80421c2458d90cd14d7c3ba65d76 (diff) | |
| download | rneovim-fbd8209286373843b7e9b4151a1432fc4555484d.tar.gz rneovim-fbd8209286373843b7e9b4151a1432fc4555484d.tar.bz2 rneovim-fbd8209286373843b7e9b4151a1432fc4555484d.zip | |
vim-patch:8.0.0645: no error for illegal back reference in NFA engine
Problem: The new regexp engine does not give an error for using a back
reference where it is not allowed. (Dominique Pelle)
Solution: Check the back reference like the old engine. (closes vim/vim#1774)
https://github.com/vim/vim/commit/1ef9bbe215e13a273e74fccaddd8fc5a42c76b6e
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_hlsearch.vim | 4 | ||||
| -rw-r--r-- | src/nvim/testdir/test_regexp_latin.vim | 10 | ||||
| -rw-r--r-- | src/nvim/testdir/test_statusline.vim | 2 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/nvim/testdir/test_hlsearch.vim b/src/nvim/testdir/test_hlsearch.vim index dd0b05da98..18c4cb37b4 100644 --- a/src/nvim/testdir/test_hlsearch.vim +++ b/src/nvim/testdir/test_hlsearch.vim @@ -37,11 +37,11 @@ func Test_hlsearch_hangs() return endif - " This pattern takes forever to match, it should timeout. + " This pattern takes a long time to match, it should timeout. help let start = reltime() set hlsearch nolazyredraw redrawtime=101 - let @/ = '\%#=2\v(a|\1)*' + let @/ = '\%#=1a*.*X\@<=b*' redraw let elapsed = reltimefloat(reltime(start)) call assert_true(elapsed > 0.1) diff --git a/src/nvim/testdir/test_regexp_latin.vim b/src/nvim/testdir/test_regexp_latin.vim index 8f9b1eb7ca..0619e9c027 100644 --- a/src/nvim/testdir/test_regexp_latin.vim +++ b/src/nvim/testdir/test_regexp_latin.vim @@ -63,3 +63,13 @@ func Test_rex_init() bwipe! set re=0 endfunc + +func Test_backref() + new + call setline(1, ['one', 'two', 'three', 'four', 'five']) + call assert_equal(3, search('\%#=1\(e\)\1')) + call assert_equal(3, search('\%#=2\(e\)\1')) + call assert_fails('call search("\\%#=1\\(e\\1\\)")', 'E65:') + call assert_fails('call search("\\%#=2\\(e\\1\\)")', 'E65:') + bwipe! +endfunc diff --git a/src/nvim/testdir/test_statusline.vim b/src/nvim/testdir/test_statusline.vim index cf85bd58ac..351b119acd 100644 --- a/src/nvim/testdir/test_statusline.vim +++ b/src/nvim/testdir/test_statusline.vim @@ -223,7 +223,7 @@ func Test_statusline() set statusline=ab%(cd%q%)de call assert_match('^abde\s*$', s:get_statusline()) copen - call assert_match('^abcd\[Quickfix List\1]de\s*$', s:get_statusline()) + call assert_match('^abcd\[Quickfix List]de\s*$', s:get_statusline()) cclose " %#: Set highlight group. The name must follow and then a # again. |