aboutsummaryrefslogtreecommitdiff
path: root/test/old
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-05-24 15:04:33 +0800
committerGitHub <noreply@github.com>2024-05-24 15:04:33 +0800
commitc836383d21b6d38ecf59e46e76da55ca97a4fc65 (patch)
tree0773ef903ed15d4024eaf7beca17ee79ecc6d6ff /test/old
parent521b9930b87cf5c4c853fc5080f5421d6bda23c9 (diff)
downloadrneovim-c836383d21b6d38ecf59e46e76da55ca97a4fc65.tar.gz
rneovim-c836383d21b6d38ecf59e46e76da55ca97a4fc65.tar.bz2
rneovim-c836383d21b6d38ecf59e46e76da55ca97a4fc65.zip
vim-patch:9.1.0438: Wrong Ex command executed when :g uses '?' as delimiter (#28956)
Problem: Wrong Ex command executed when :g uses '?' as delimiter and pattern contains escaped '?'. Solution: Don't use "*newp" when it's not allocated (zeertzjq). closes: vim/vim#14837 https://github.com/vim/vim/commit/3074137542961ce7b3b65c14ebde75f13f5e6147
Diffstat (limited to 'test/old')
-rw-r--r--test/old/testdir/test_global.vim11
-rw-r--r--test/old/testdir/test_substitute.vim4
2 files changed, 12 insertions, 3 deletions
diff --git a/test/old/testdir/test_global.vim b/test/old/testdir/test_global.vim
index 44a8784348..8c7e7cb26b 100644
--- a/test/old/testdir/test_global.vim
+++ b/test/old/testdir/test_global.vim
@@ -96,7 +96,16 @@ func Test_global_newline()
close!
endfunc
-func Test_wrong_delimiter()
+" Test :g with ? as delimiter.
+func Test_global_question_delimiter()
+ new
+ call setline(1, ['aaaaa', 'b?bbb', 'ccccc', 'ddd?d', 'eeeee'])
+ g?\??delete
+ call assert_equal(['aaaaa', 'ccccc', 'eeeee'], getline(1, '$'))
+ bwipe!
+endfunc
+
+func Test_global_wrong_delimiter()
call assert_fails('g x^bxd', 'E146:')
endfunc
diff --git a/test/old/testdir/test_substitute.vim b/test/old/testdir/test_substitute.vim
index bce2e6ea73..fdb0f6fc37 100644
--- a/test/old/testdir/test_substitute.vim
+++ b/test/old/testdir/test_substitute.vim
@@ -174,8 +174,8 @@ func Test_substitute_repeat()
bwipe!
endfunc
-" Test :s with ? as separator.
-func Test_substitute_question_separator()
+" Test :s with ? as delimiter.
+func Test_substitute_question_delimiter()
new
call setline(1, '??:??')
%s?\?\??!!?g