diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-11-05 16:32:58 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-05 16:32:58 +0800 |
| commit | 1bcddd5b53a0993789df7ec91fecea47dcfcccfa (patch) | |
| tree | 774c6d91442f0035ac7e03729be79a53fcfc257d /src/nvim/testdir | |
| parent | 45a3e7f6694c66c3577a47c7ff1fb8bfcc2ab7be (diff) | |
| parent | e33ffab1a776518dbf59ba5fe82453fa019569eb (diff) | |
| download | rneovim-1bcddd5b53a0993789df7ec91fecea47dcfcccfa.tar.gz rneovim-1bcddd5b53a0993789df7ec91fecea47dcfcccfa.tar.bz2 rneovim-1bcddd5b53a0993789df7ec91fecea47dcfcccfa.zip | |
Merge pull request #20943 from zeertzjq/vim-8.2.4688
vim-patch:8.2.{4688,4693,4978},9.0.0053: regexp fixes
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_regexp_latin.vim | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_regexp_latin.vim b/src/nvim/testdir/test_regexp_latin.vim index 2a9a0e9d50..ece6ae518e 100644 --- a/src/nvim/testdir/test_regexp_latin.vim +++ b/src/nvim/testdir/test_regexp_latin.vim @@ -105,6 +105,31 @@ func Test_multi_failure() set re=0 endfunc +func Test_column_success_failure() + new + call setline(1, 'xbar') + + set re=1 + %s/\%>0v./A/ + call assert_equal('Abar', getline(1)) + call assert_fails('/\%v', 'E71:') + call assert_fails('/\%>v', 'E71:') + call assert_fails('/\%c', 'E71:') + call assert_fails('/\%<c', 'E71:') + call assert_fails('/\%l', 'E71:') + set re=2 + %s/\%>0v./B/ + call assert_equal('Bbar', getline(1)) + call assert_fails('/\%v', 'E1273:') + call assert_fails('/\%>v', 'E1273:') + call assert_fails('/\%c', 'E1273:') + call assert_fails('/\%<c', 'E1273:') + call assert_fails('/\%l', 'E1273:') + + set re=0 + bwipe! +endfunc + func Test_recursive_addstate() throw 'skipped: TODO: ' " This will call addstate() recursively until it runs into the limit. @@ -1033,6 +1058,28 @@ func Test_using_invalid_visual_position() bwipe! endfunc +func Test_using_two_engines_pattern() + new + call setline(1, ['foobar=0', 'foobar=1', 'foobar=2']) + " \%#= at the end of the pattern + for i in range(0, 2) + for j in range(0, 2) + exe "set re=" .. i + call cursor(j + 1, 7) + call assert_fails("%s/foobar\\%#=" .. j, 'E1281:') + endfor + endfor + set re=0 + + " \%#= at the start of the pattern + for i in range(0, 2) + call cursor(i + 1, 7) + exe ":%s/\\%#=" .. i .. "foobar=" .. i .. "/xx" + endfor + call assert_equal(['xx', 'xx', 'xx'], getline(1, '$')) + bwipe! +endfunc + func Test_recursive_substitute_expr() new func Repl() |