diff options
Diffstat (limited to 'tests/test-pearl-reverse-compile.el')
| -rw-r--r-- | tests/test-pearl-reverse-compile.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test-pearl-reverse-compile.el b/tests/test-pearl-reverse-compile.el index ec67391..382c72a 100644 --- a/tests/test-pearl-reverse-compile.el +++ b/tests/test-pearl-reverse-compile.el @@ -57,6 +57,24 @@ (ert-deftest test-pearl-rc-roundtrip-state-name () (test-pearl-rc--should-roundtrip '(:state "In Progress"))) +(ert-deftest test-pearl-rc-roundtrip-state-name-list () + "A multi-state :state round-trips (state.name.in with several names)." + (let ((r (test-pearl-rc--roundtrip '(:state ("Todo" "In Review"))))) + (should (eq 'ok (car r))) + (should (equal (cdr r) '(:state ("Todo" "In Review")))))) + +(ert-deftest test-pearl-rc-state-name-in-many-to-list () + "state.name.in with several names reverse-compiles to a list :state." + (should (equal (test-pearl-rc--from-json + "{\"state\":{\"name\":{\"in\":[\"Todo\",\"In Review\"]}}}") + '(ok :state ("Todo" "In Review"))))) + +(ert-deftest test-pearl-rc-state-name-in-one-to-scalar () + "state.name.in with one name normalizes to a scalar :state." + (should (equal (test-pearl-rc--from-json + "{\"state\":{\"name\":{\"in\":[\"Todo\"]}}}") + '(ok :state "Todo")))) + (ert-deftest test-pearl-rc-roundtrip-state-type-single () (let ((r (test-pearl-rc--roundtrip '(:state-type "started")))) (should (eq 'ok (car r))) |
