diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2019-03-08 13:21:11 +0100 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2019-03-08 13:21:11 +0100 |
| commit | 4352d41db0d93ab9266c64be48eda872cb5ea589 (patch) | |
| tree | a10aa3db77c6db9c7c809200569a9bdd15119f92 /src/nvim/testdir | |
| parent | 0355c1ed9c481d4ad3bf24887e0af869834e1b40 (diff) | |
| parent | 96e2c3945f13453070894c70c74e4da29d421dab (diff) | |
| download | rneovim-4352d41db0d93ab9266c64be48eda872cb5ea589.tar.gz rneovim-4352d41db0d93ab9266c64be48eda872cb5ea589.tar.bz2 rneovim-4352d41db0d93ab9266c64be48eda872cb5ea589.zip | |
Merge #9662 'vim-patch:8.0.{0643-0646}'
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_hlsearch.vim | 19 | ||||
| -rw-r--r-- | src/nvim/testdir/test_regexp_latin.vim | 10 | ||||
| -rw-r--r-- | src/nvim/testdir/test_statusline.vim | 2 |
3 files changed, 30 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_hlsearch.vim b/src/nvim/testdir/test_hlsearch.vim index 1fc7b04f88..97f6ae7b51 100644 --- a/src/nvim/testdir/test_hlsearch.vim +++ b/src/nvim/testdir/test_hlsearch.vim @@ -32,6 +32,25 @@ function! Test_hlsearch() enew! endfunction +func Test_hlsearch_hangs() + if !has('reltime') || !has('float') + return + endif + + " This pattern takes a long time to match, it should timeout. + new + call setline(1, ['aaa', repeat('abc ', 100000), 'ccc']) + let start = reltime() + set hlsearch nolazyredraw redrawtime=101 + let @/ = '\%#=1a*.*X\@<=b*' + redraw + let elapsed = reltimefloat(reltime(start)) + call assert_true(elapsed > 0.1) + call assert_true(elapsed < 1.0) + set nohlsearch redrawtime& + bwipe! +endfunc + func Test_hlsearch_eol_highlight() new call append(1, repeat([''], 9)) 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. |