comparison src/testdir/test_substitute.vim @ 19308:6fd567c927c0 v8.2.0212

patch 8.2.0212: missing search/substitute pattern hardly tested Commit: https://github.com/vim/vim/commit/07ada5ff2fd8f22ed3233ae5c4ddf87c7b3f56fe Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 5 20:38:22 2020 +0100 patch 8.2.0212: missing search/substitute pattern hardly tested Problem: Missing search/substitute pattern hardly tested. Solution: Add test_clear_search_pat() and tests. (Yegappan Lakshmanan, closes #5579)
author Bram Moolenaar <Bram@vim.org>
date Wed, 05 Feb 2020 20:45:04 +0100
parents 1b02482e6a61
children 02111977dd05
comparison
equal deleted inserted replaced
19307:95f6fdf33667 19308:6fd567c927c0
801 s/b/\=repeat('B', 10)/g 801 s/b/\=repeat('B', 10)/g
802 call assert_equal(repeat('aBBBBBBBBBBc', 8), getline(1)) 802 call assert_equal(repeat('aBBBBBBBBBBc', 8), getline(1))
803 close! 803 close!
804 endfunc 804 endfunc
805 805
806 " Test for command failures when the last substitute pattern is not set.
807 func Test_sub_with_no_last_pat()
808 call test_clear_search_pat()
809 call assert_fails('~', 'E33:')
810 call assert_fails('s//abc/g', 'E476:')
811 call assert_fails('s\/bar', 'E476:')
812 call assert_fails('s\&bar&', 'E476:')
813
814 call test_clear_search_pat()
815 let save_cpo = &cpo
816 set cpo+=/
817 call assert_fails('s/abc/%/', 'E33:')
818 let &cpo = save_cpo
819 endfunc
820
806 " vim: shiftwidth=2 sts=2 expandtab 821 " vim: shiftwidth=2 sts=2 expandtab