From 02af750b16f7a7a547a4e2fdf15fe2e4d0bbccde Mon Sep 17 00:00:00 2001 From: Patrick Winter Date: Mon, 4 Nov 2019 15:36:46 +0100 Subject: [PATCH] Add unit test to test parsing of the id on newly created tasks --- test/taskwarrior-test.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/taskwarrior-test.el b/test/taskwarrior-test.el index c676f84..3dfb10c 100644 --- a/test/taskwarrior-test.el +++ b/test/taskwarrior-test.el @@ -18,5 +18,11 @@ (should (string= (aref (alist-get 'tags task) 0) "emacs")) (should (string= (alist-get 'description task) "Write test suite for taskwarrior.el (using ERT)")))) +(ert-deftest taskwarrior-parse-task-id () + (should (string= (taskwarrior--parse-created-task-id "Created task 9.") "9")) + (should (string= (taskwarrior--parse-created-task-id "Created task 1000.") "1000")) + (should (string= (taskwarrior--parse-created-task-id "Some invalid input") nil))) + + (provide 'taskwarrior-test) ;;; taskwarrior-test.el ends here