diff src/testing.c @ 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 b780229f5792
children 6c944fee0d7e
line wrap: on
line diff
--- a/src/testing.c
+++ b/src/testing.c
@@ -632,6 +632,19 @@ f_test_autochdir(typval_T *argvars UNUSE
 }
 
 /*
+ * "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()"
  */
     void