diff --git a/mostalive/convert-chats-to-org.el b/mostalive/convert-chats-to-org.el index eb5ef01..db8852b 100644 --- a/mostalive/convert-chats-to-org.el +++ b/mostalive/convert-chats-to-org.el @@ -1,6 +1,6 @@ ;;; 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." (interactive) (save-excursion @@ -8,13 +8,16 @@ (while (re-search-forward "hours ago" nil t) (replace-match "")))) -(ert-deftest test-format-chat-messages-adds-separators () - (should - (string= - (with-temp-buffer - (org-mode) - (insert "marcevers\n 17 hours ago\n sentence 1\n") + + +(ert-deftest test-chat-remove-hours-ago () + (should (string= +(with-temp-buffer + (insert "marcevers\n17 hours ago\n sentence 1\n") (goto-char (point-min)) - (format-chat-messages) - ) - "|marcevers | sentence1\n"))) + (chat-remove-hours-ago) + (buffer-string)) + "marcevers\n17 \n sentence 1\n" +))) + +(ert 'test-chat-remove-hours-ago )