]> granicus.if.org Git - vim/commitdiff
patch 8.2.0250: test_clear_search_pat() is unused v8.2.0250
authorBram Moolenaar <Bram@vim.org>
Wed, 12 Feb 2020 21:15:19 +0000 (22:15 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 12 Feb 2020 21:15:19 +0000 (22:15 +0100)
Problem:    test_clear_search_pat() is unused.
Solution:   Remove the function. (Yegappan Lakshmanan, closes #5624)

12 files changed:
runtime/doc/eval.txt
runtime/doc/testing.txt
runtime/doc/usr_41.txt
src/evalfunc.c
src/proto/regexp.pro
src/proto/search.pro
src/proto/testing.pro
src/regexp.c
src/search.c
src/testdir/test_writefile.vim
src/testing.c
src/version.c

index afbfd9f7e5b443f6816a8128396b6bbb88197c67..d7c0dc3a8b1fb8fb62e497e26bd6a71f689a6fd5 100644 (file)
@@ -2848,7 +2848,6 @@ term_wait({buf} [, {time}])       Number  wait for screen to be updated
 test_alloc_fail({id}, {countdown}, {repeat})
                                none    make memory allocation fail
 test_autochdir()               none    enable 'autochdir' during startup
-test_clear_search_pat()                none    clears the last used search pattern
 test_feedinput({string})       none    add key sequence to input buffer
 test_garbagecollect_now()      none    free memory right now for testing
 test_garbagecollect_soon()     none    free memory soon for testing
index f2a7cf16c55cbddb83b4198c3c7a46f16a7e28c4..f343e86a6d936fc275582382f1de498dbec0f957 100644 (file)
@@ -52,11 +52,6 @@ test_autochdir()                                     *test_autochdir()*
                startup has finished.
 
 
-test_clear_search_pat()                                *test_clear_search_pat()*
-               Clears the last used search pattern (|/|) and the substitute
-               pattern (|:s|). This is useful for testing conditions where
-               these patterns are not set previously.
-
 test_feedinput({string})                               *test_feedinput()*
                Characters in {string} are queued for processing as if they
                were typed by the user. This uses a low level input buffer.
index 316eebcaea05312d9368b44d3a1b4b81b0a6df96..1bed01f418e87a4cc762ed6c62cf18a41173144c 100644 (file)
@@ -963,7 +963,6 @@ Testing:                                *test-functions*
        assert_report()         report a test failure
        test_alloc_fail()       make memory allocation fail
        test_autochdir()        enable 'autochdir' during startup
-       test_clear_search_pat() clears the last used search pattern
        test_override()         test with Vim internal overrides
        test_garbagecollect_now()   free memory right now
        test_getvalue()         get value of an internal variable
index 66be42c241a43fa463c975f885caca2439ccf639..58f1218f21b1fdfd03295fb28e169e4711ff9ccd 100644 (file)
@@ -811,7 +811,6 @@ static funcentry_T global_functions[] =
 #endif
     {"test_alloc_fail",        3, 3, FEARG_1,    &t_void,      f_test_alloc_fail},
     {"test_autochdir", 0, 0, 0,          &t_void,      f_test_autochdir},
-    {"test_clear_search_pat",  0, 0, 0,  &t_void,      f_test_clear_search_pat},
     {"test_feedinput", 1, 1, FEARG_1,    &t_void,      f_test_feedinput},
     {"test_garbagecollect_now",        0, 0, 0,  &t_void,      f_test_garbagecollect_now},
     {"test_garbagecollect_soon", 0, 0, 0, &t_void,     f_test_garbagecollect_soon},
index 5e8e1a58a628cb87b89adea02ba181bd2fcdefa7..01f1fff0d7e8430182e2f94350c672b58f9d50ee 100644 (file)
@@ -12,7 +12,6 @@ int vim_regcomp_had_eol(void);
 regprog_T *vim_regcomp(char_u *expr_arg, int re_flags);
 void vim_regfree(regprog_T *prog);
 void free_regexp_stuff(void);
-void free_regexp_prev_sub(void);
 int regprog_in_use(regprog_T *prog);
 int vim_regexec_prog(regprog_T **prog, int ignore_case, char_u *line, colnr_T col);
 int vim_regexec(regmatch_T *rmp, char_u *line, colnr_T col);
index 3b46c0662cd36c4c9ff573119c7d0926db91518a..e6ac11b2cb2e549fe6736905d08e1a1b2a7a9168 100644 (file)
@@ -9,7 +9,6 @@ void free_search_patterns(void);
 void save_last_search_pattern(void);
 void restore_last_search_pattern(void);
 char_u *last_search_pattern(void);
-void free_last_pat(int idx);
 int ignorecase(char_u *pat);
 int ignorecase_opt(char_u *pat, int ic_in, int scs);
 int pat_has_uppercase(char_u *pat);
index 209abf3486176ad907ec1bd7befa5042b308a564..2b001a543a6abeb2848e1dfc965da12685960f96 100644 (file)
@@ -13,7 +13,6 @@ void f_assert_report(typval_T *argvars, typval_T *rettv);
 void f_assert_true(typval_T *argvars, typval_T *rettv);
 void f_test_alloc_fail(typval_T *argvars, typval_T *rettv);
 void f_test_autochdir(typval_T *argvars, typval_T *rettv);
-void f_test_clear_search_pat(typval_T *argvars, typval_T *rettv);
 void f_test_feedinput(typval_T *argvars, typval_T *rettv);
 void f_test_getvalue(typval_T *argvars, typval_T *rettv);
 void f_test_option_not_set(typval_T *argvars, typval_T *rettv);
index 7aeddb83cd5f06e7f1cbc2d2500e6dea5a423b92..ef3896c0a4d7a97ae35bfd29454196345da617d4 100644 (file)
@@ -2663,15 +2663,6 @@ free_regexp_stuff(void)
 }
 #endif
 
-/*
- * Free the previously used substitute search pattern.
- */
-    void
-free_regexp_prev_sub(void)
-{
-    VIM_CLEAR(reg_prev_sub);
-}
-
 #ifdef FEAT_EVAL
     static void
 report_re_switch(char_u *pat)
index 08915578fc0efc8b9aaff832de3773dca9e947b2..3b310dc2a96b097e9ffc64e0964a0835dad4a9d6 100644 (file)
@@ -380,12 +380,6 @@ last_search_pattern(void)
 }
 #endif
 
-    void
-free_last_pat(int idx)
-{
-    VIM_CLEAR(spats[idx].pat);
-}
-
 /*
  * Return TRUE when case should be ignored for search pattern "pat".
  * Uses the 'ignorecase' and 'smartcase' options.
index 98a06eb01154cdcb452c7a2296299ec6f0289825..f616980f35e7f9a78b70c13534eb17d09e736115 100644 (file)
@@ -214,6 +214,10 @@ func Test_write_errors()
   call assert_fails('1,2write', 'E140:')
   close!
 
+  call assert_fails('w > Xtest', 'E494:')
+
+  call assert_fails('w > Xtest', 'E494:')
+
   " Try to overwrite a directory
   if has('unix')
     call mkdir('Xdir1')
index c2b382b8b6da0e31466085febfbb052b2325a28c..5dacf073b344525fe782b75836a0bfcae128a938 100644 (file)
@@ -631,19 +631,6 @@ f_test_autochdir(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
 #endif
 }
 
-/*
- * "test_clear_search_pat()"
- * Free the last search and substitute patterns
- */
-    void
-f_test_clear_search_pat(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
-{
-    free_last_pat(RE_SUBST);
-    free_last_pat(RE_SEARCH);
-    set_old_sub(NULL);
-    free_regexp_prev_sub();
-}
-
 /*
  * "test_feedinput()"
  */
index 7c31c195da5db0a3d0d2a17c1c63eab4ec725eeb..a28fc03858255acd95dc36a15fa5bec95c43afb9 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    250,
 /**/
     249,
 /**/