diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-26 09:13:30 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-26 09:13:30 -0400 |
| commit | fd91e73c57b2dd95e9395fef04c82b80b9c779bc (patch) | |
| tree | 1d8663a2bdae23fc5a86c6a104a15743456ea44d /src/nvim/testdir | |
| parent | a282a177d3320db25fa8f854cbcdbe0bc6abde7f (diff) | |
| parent | a7061359b741b5716bddbefdc024f38405f758b0 (diff) | |
| download | rneovim-fd91e73c57b2dd95e9395fef04c82b80b9c779bc.tar.gz rneovim-fd91e73c57b2dd95e9395fef04c82b80b9c779bc.tar.bz2 rneovim-fd91e73c57b2dd95e9395fef04c82b80b9c779bc.zip | |
Merge pull request #14640 from janlazo/vim-3ec3217f0491
vim-patch:3ec3217f0491,8.2.{2278,2885}
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_regexp_utf8.vim | 46 | ||||
| -rw-r--r-- | src/nvim/testdir/test_search.vim | 19 |
2 files changed, 63 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_regexp_utf8.vim b/src/nvim/testdir/test_regexp_utf8.vim index 513780938e..d8d5797dcf 100644 --- a/src/nvim/testdir/test_regexp_utf8.vim +++ b/src/nvim/testdir/test_regexp_utf8.vim @@ -542,6 +542,52 @@ func Test_match_start_of_line_combining() bwipe! endfunc +" Check that [[:upper:]] matches for automatic engine +func Test_match_char_class_upper() + new + let _engine=®expengine + + " Test 1: [[:upper:]]\{2,\} + set regexpengine=0 + call setline(1, ['05. ПЕСНЯ О ГЕРОЯХ муз. А. Давиденко, М. Коваля и Б. Шехтера ...', '05. PJESNJA O GJEROJAKH mus. A. Davidjenko, M. Kovalja i B. Shjekhtjera ...']) + call cursor(1,1) + let search_cmd='norm /\<[[:upper:]]\{2,\}\>' .. "\<CR>" + exe search_cmd + call assert_equal(4, searchcount().total, 'TEST 1') + set regexpengine=1 + exe search_cmd + call assert_equal(2, searchcount().total, 'TEST 1') + set regexpengine=2 + exe search_cmd + call assert_equal(4, searchcount().total, 'TEST 1') + + " Test 2: [[:upper:]].\+ + let search_cmd='norm /\<[[:upper:]].\+\>' .. "\<CR>" + set regexpengine=0 + exe search_cmd + call assert_equal(2, searchcount().total, 'TEST 2') + set regexpengine=1 + exe search_cmd + call assert_equal(1, searchcount().total, 'TEST 2') + set regexpengine=2 + exe search_cmd + call assert_equal(2, searchcount().total, 'TEST 2') + + " Test 3: [[:lower:]]\+ + let search_cmd='norm /\<[[:lower:]]\+\>' .. "\<CR>" + set regexpengine=0 + exe search_cmd + call assert_equal(4, searchcount().total, 'TEST 3 lower') + set regexpengine=1 + exe search_cmd + call assert_equal(2, searchcount().total, 'TEST 3 lower') + set regexpengine=2 + exe search_cmd + call assert_equal(4, searchcount().total, 'TEST 3 lower') + " clean up + let ®expengine=_engine + bwipe! +endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index 75d42b986b..b391663e0f 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -1177,13 +1177,28 @@ func Test_look_behind() bwipe! endfunc +func Test_search_visual_area_linewise() + new + call setline(1, ['aa', 'bb', 'cc']) + exe "normal 2GV\<Esc>" + for engine in [1, 2] + exe 'set regexpengine=' .. engine + exe "normal gg/\\%'<\<CR>>" + call assert_equal([0, 2, 1, 0, 1], getcurpos(), 'engine ' .. engine) + exe "normal gg/\\%'>\<CR>" + call assert_equal([0, 2, 2, 0, 2], getcurpos(), 'engine ' .. engine) + endfor + + bwipe! + set regexpengine& +endfunc + func Test_search_sentence() new " this used to cause a crash - call assert_fails("/\\%')", 'E486') - call assert_fails("/", 'E486') /\%'( / + bwipe endfunc " Test that there is no crash when there is a last search pattern but no last |