From 88eca5f5352b8766b10d80762a63f7bf6f4c234c Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Tue, 22 Jun 2021 23:47:15 -0400 Subject: [PATCH] tests: Add test for TW #1804 --- test/tw-1804.t | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 test/tw-1804.t diff --git a/test/tw-1804.t b/test/tw-1804.t new file mode 100755 index 000000000..da55aab2b --- /dev/null +++ b/test/tw-1804.t @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +. bash_tap_tw.sh + +# Import a task with annotation without an description +# Should fail +OUTPUT=`echo '{"description":"Buy the milk","annotations":[{"entry": 1234567890}]}' | task import - 2>&1` || : +[[ $OUTPUT =~ "missing a description" ]] + +# Check that the task was NOT added +[[ `task count` == 0 ]] + +# Import a task with annotation without an entry +echo '{"description":"Buy the milk","annotations":[{"description":"and Cheese"}]}' | task import - + +# Check that the task was added +[[ `task count` == 1 ]] +[[ `task milk count` == 1 ]] +[[ `task _get 1.annotations.count` == 1 ]]