comparison src/testdir/test_substitute.vim @ 21265:6a4806e326dd v8.2.1183

patch 8.2.1183: assert_fails() checks the last error message Commit: https://github.com/vim/vim/commit/9b7bf9e98f06ece595fed7a3ff53ecce89797a53 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 11 22:14:59 2020 +0200 patch 8.2.1183: assert_fails() checks the last error message Problem: assert_fails() checks the last error message. Solution: Check the first error, it is more relevant. Fix all the tests that rely on the old behavior.
author Bram Moolenaar <Bram@vim.org>
date Sat, 11 Jul 2020 22:30:07 +0200
parents b07672d13ff9
children ff21e2962490
comparison
equal deleted inserted replaced
21264:f3bdfe1d9359 21265:6a4806e326dd
233 new 233 new
234 call setline(1, 'foobar') 234 call setline(1, 'foobar')
235 235
236 call assert_fails('s/FOO/bar/', 'E486:') 236 call assert_fails('s/FOO/bar/', 'E486:')
237 call assert_fails('s/foo/bar/@', 'E488:') 237 call assert_fails('s/foo/bar/@', 'E488:')
238 call assert_fails('s/\(/bar/', 'E476:') 238 call assert_fails('s/\(/bar/', 'E54:')
239 call assert_fails('s afooabara', 'E146:') 239 call assert_fails('s afooabara', 'E146:')
240 call assert_fails('s\\a', 'E10:') 240 call assert_fails('s\\a', 'E10:')
241 241
242 setl nomodifiable 242 setl nomodifiable
243 call assert_fails('s/foo/bar/', 'E21:') 243 call assert_fails('s/foo/bar/', 'E21:')
815 815
816 " Test for command failures when the last substitute pattern is not set. 816 " Test for command failures when the last substitute pattern is not set.
817 func Test_sub_with_no_last_pat() 817 func Test_sub_with_no_last_pat()
818 let lines =<< trim [SCRIPT] 818 let lines =<< trim [SCRIPT]
819 call assert_fails('~', 'E33:') 819 call assert_fails('~', 'E33:')
820 call assert_fails('s//abc/g', 'E476:') 820 call assert_fails('s//abc/g', 'E35:')
821 call assert_fails('s\/bar', 'E476:') 821 call assert_fails('s\/bar', 'E35:')
822 call assert_fails('s\&bar&', 'E476:') 822 call assert_fails('s\&bar&', 'E33:')
823 call writefile(v:errors, 'Xresult') 823 call writefile(v:errors, 'Xresult')
824 qall! 824 qall!
825 [SCRIPT] 825 [SCRIPT]
826 call writefile(lines, 'Xscript') 826 call writefile(lines, 'Xscript')
827 if RunVim([], [], '--clean -S Xscript') 827 if RunVim([], [], '--clean -S Xscript')