diff options
author | Tobias Brox <t@tobixen.no> | 2015-05-02 07:40:58 +0200 |
---|---|---|
committer | Tobias Brox <t@tobixen.no> | 2015-05-02 07:40:58 +0200 |
commit | ae8979ed0701dd49a787f4edec939083f0f3db4e (patch) | |
tree | c40c994e5d8507a5dddf5375649cb16059285c2a /tests | |
parent | 5d879b61011ce0d793e302608c66ba870212d6e7 (diff) | |
download | calendar-cli-ae8979ed0701dd49a787f4edec939083f0f3db4e.zip |
releasing version 0.10
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/script_test.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/script_test.sh b/tests/script_test.sh index 001bb3a..375acdb 100755 --- a/tests/script_test.sh +++ b/tests/script_test.sh @@ -26,6 +26,8 @@ calendar_cli() { ## TESTING +## EVENTS + echo "## testing $calendar_cli" echo "## this is a very simple test script without advanced error handling" echo "## if this test script doesn't output 'all tests completed' in the end, something went wrong" @@ -57,4 +59,31 @@ echo "## Searching again for the deleted event" calendar_cli calendar agenda --from-time=2010-10-10 --agenda-days=1 echo $output | { grep -q 'testing testing' && echo "## FAIL: still found the event" ; } || echo "## OK: didn't find the event" +## TODOS / TASK LISTS + +echo "## Attempting to add a task with category 'scripttest'" +calendar_cli todo add --set-categories scripttest "edit this task" +uidtodo1=$(echo $output | perl -ne '/uid=(.*)$/ && print $1') + +echo "## Listing out all tasks with category set to 'scripttest'" +calendar_cli todo --categories scripttest list +[ $(echo "$output" | wc -l) == 1 ] && echo "## OK: found the todo item we just added and nothing more" + +echo "## Editing the task" +calendar_cli todo --categories scripttest edit --set-comment "editing" --add-categories "scripttest2" + +echo "## Verifying that the edits got through" +calendar_cli todo --categories scripttest list +[ $(echo "$output" | wc -l) == 1 ] && echo "## OK: found the todo item we just edited and nothing more" +calendar_cli todo --categories scripttest2 list +[ $(echo "$output" | wc -l) == 1 ] && echo "## OK: found the todo item we just edited and nothing more" +calendar_cli todo --comment editing list +[ $(echo "$output" | wc -l) == 1 ] && echo "## OK: found the todo item we just edited and nothing more" + +echo "## Complete the task" +calendar_cli todo --categories scripttest complete +calendar_cli todo --categories scripttest list +[ -z "$output" ] && echo "## OK: todo-item is done" +calendar_cli todo --todo-uid $todouid1 delete + echo "## all tests completed" |