Add test for taskwarrior--add
This commit is contained in:
parent
0fa25884f9
commit
703994420c
1 changed files with 19 additions and 0 deletions
19
taskwarrior-test.el
Normal file
19
taskwarrior-test.el
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
;;; taskwarrior-test.el --- taskwarrior unit tests
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Run standalone with this,
|
||||||
|
;; emacs -batch -L . -l taskwarrior-test.el -f ert-run-tests-batch
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(require 'ert)
|
||||||
|
|
||||||
|
|
||||||
|
(ert-deftest taskwarrior-add-task-test ()
|
||||||
|
"Ensure that special characters such as quotes and parens are properly escaped when adding new tasks"
|
||||||
|
(let* ((task-id (taskwarrior--add "project:ert +emacs \"Write test suite for taskwarrior.el (using ERT)\""))
|
||||||
|
(task (taskwarrior-export-task task-id)))
|
||||||
|
(should (string= (alist-get 'project task) "ert"))
|
||||||
|
(should (string= (aref (alist-get 'tags task) 0) "emacs"))
|
||||||
|
(should (string= (alist-get 'description task) "Write test suite for taskwarrior.el (using ERT)")))
|
Loading…
Reference in a new issue