diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/progmodes/grep-tests.el | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/lisp/progmodes/grep-tests.el b/test/lisp/progmodes/grep-tests.el index 39307999d6d..9b7f83086bf 100644 --- a/test/lisp/progmodes/grep-tests.el +++ b/test/lisp/progmodes/grep-tests.el | |||
| @@ -66,4 +66,18 @@ | |||
| 66 | (cl-letf (((symbol-function 'w32-shell-dos-semantics) #'ignore)) | 66 | (cl-letf (((symbol-function 'w32-shell-dos-semantics) #'ignore)) |
| 67 | (grep-tests--check-rgrep-abbreviation)))) | 67 | (grep-tests--check-rgrep-abbreviation)))) |
| 68 | 68 | ||
| 69 | (ert-deftest grep-tests--grep-heading-regexp-without-null () | ||
| 70 | (dolist (sep '(?: ?- ?=)) | ||
| 71 | (let ((string (format "filename%c123%ctext" sep sep))) | ||
| 72 | (should (string-match grep-heading-regexp string)) | ||
| 73 | (should (equal (match-string 1 string) "filename")) | ||
| 74 | (should (equal (match-string 2 string) (format "filename%c" sep)))))) | ||
| 75 | |||
| 76 | (ert-deftest grep-tests--grep-heading-regexp-with-null () | ||
| 77 | (dolist (sep '(?: ?- ?=)) | ||
| 78 | (let ((string (format "funny:0:filename%c123%ctext" 0 sep))) | ||
| 79 | (should (string-match grep-heading-regexp string)) | ||
| 80 | (should (equal (match-string 1 string) "funny:0:filename")) | ||
| 81 | (should (equal (match-string 2 string) "funny:0:filename\0"))))) | ||
| 82 | |||
| 69 | ;;; grep-tests.el ends here | 83 | ;;; grep-tests.el ends here |