Mercurial > vim
comparison src/testdir/test_regexp_latin.vim @ 23150:90b16a0022e5 v8.2.2121
patch 8.2.2121: internal error when using ze before zs in a pattern
Commit: https://github.com/vim/vim/commit/a7a691cc142439e266f4ceb1f208bb952b57aa71
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Dec 9 16:36:04 2020 +0100
patch 8.2.2121: internal error when using \ze before \zs in a pattern
Problem: Internal error when using \ze before \zs in a pattern.
Solution: Check the end is never before the start. (closes https://github.com/vim/vim/issues/7442)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 09 Dec 2020 16:45:04 +0100 |
parents | 08940efa6b4e |
children | ed0fc4787392 |
comparison
equal
deleted
inserted
replaced
23149:e427a5961456 | 23150:90b16a0022e5 |
---|---|
909 set regexpengine=2 | 909 set regexpengine=2 |
910 call Regex_start_end_buffer() | 910 call Regex_start_end_buffer() |
911 bwipe! | 911 bwipe! |
912 endfunc | 912 endfunc |
913 | 913 |
914 func Test_ze_before_zs() | |
915 call assert_equal('', matchstr(' ', '\%#=1\ze \zs')) | |
916 call assert_equal('', matchstr(' ', '\%#=2\ze \zs')) | |
917 call assert_equal(repeat([''], 10), matchlist(' ', '\%#=1\ze \zs')) | |
918 call assert_equal(repeat([''], 10), matchlist(' ', '\%#=2\ze \zs')) | |
919 endfunc | |
920 | |
914 " Check for detecting error | 921 " Check for detecting error |
915 func Test_regexp_error() | 922 func Test_regexp_error() |
916 call assert_fails("call matchlist('x x', '\\%#=1 \\zs*')", 'E888:') | 923 call assert_fails("call matchlist('x x', '\\%#=1 \\zs*')", 'E888:') |
917 call assert_fails("call matchlist('x x', '\\%#=1 \\ze*')", 'E888:') | 924 call assert_fails("call matchlist('x x', '\\%#=1 \\ze*')", 'E888:') |
918 call assert_fails("call matchlist('x x', '\\%#=2 \\zs*')", 'E888:') | 925 call assert_fails("call matchlist('x x', '\\%#=2 \\zs*')", 'E888:') |