match hours ago with line
This commit is contained in:
@@ -5,15 +5,15 @@
|
||||
(interactive)
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward (rx (one-or-more (category digit))) nil t)
|
||||
(replace-match "dada"))))
|
||||
(while (re-search-forward "[0-9]+ hours ago" nil t)
|
||||
(replace-match ""))))
|
||||
|
||||
|
||||
|
||||
(ert-deftest test-chat-remove-hours-ago ()
|
||||
(should (string=
|
||||
(with-temp-buffer
|
||||
(insert "17")
|
||||
(insert "17 hours ago")
|
||||
(goto-char (point-min))
|
||||
(chat-remove-hours-ago)
|
||||
(buffer-string))
|
||||
@@ -21,7 +21,8 @@
|
||||
|
||||
(ert-deftest test-replace-hours-ago-regexp-in-string ()
|
||||
(should (string=
|
||||
(replace-regexp-in-string "[0-9]+ hours ago" "" "11 hours ago")
|
||||
(replace-regexp-in-string "[0-9]+ hours ago" "" "space 11 hours ago")
|
||||
"")))
|
||||
|
||||
(ert 'test-replace-regexp-in-string )
|
||||
;;(ert 'test-chat-remove-hours-ago )
|
||||
|
||||
Reference in New Issue
Block a user