WIP run tests on buffer eval -
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
;;; mostalive/convert-chats-to-org.el -*- lexical-binding: t; -*-
|
;;; mostalive/convert-chats-to-org.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(defun chat-remove-hourse-ago ()
|
(defun chat-remove-hours-ago ()
|
||||||
"Format chat messages by adding '|' separator and user names."
|
"Format chat messages by adding '|' separator and user names."
|
||||||
(interactive)
|
(interactive)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
@@ -8,13 +8,16 @@
|
|||||||
(while (re-search-forward "hours ago" nil t)
|
(while (re-search-forward "hours ago" nil t)
|
||||||
(replace-match ""))))
|
(replace-match ""))))
|
||||||
|
|
||||||
(ert-deftest test-format-chat-messages-adds-separators ()
|
|
||||||
(should
|
|
||||||
(string=
|
(ert-deftest test-chat-remove-hours-ago ()
|
||||||
(with-temp-buffer
|
(should (string=
|
||||||
(org-mode)
|
(with-temp-buffer
|
||||||
(insert "marcevers\n 17 hours ago\n sentence 1\n")
|
(insert "marcevers\n17 hours ago\n sentence 1\n")
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(format-chat-messages)
|
(chat-remove-hours-ago)
|
||||||
)
|
(buffer-string))
|
||||||
"|marcevers | sentence1\n")))
|
"marcevers\n17 \n sentence 1\n"
|
||||||
|
)))
|
||||||
|
|
||||||
|
(ert 'test-chat-remove-hours-ago )
|
||||||
|
|||||||
Reference in New Issue
Block a user