Files
todo.txt-cli/tests/t1000-addlist.sh
Emil Sit 16a5103668 tests: Make test writing simpler and add two new tests.
Add a test_todo_session function to test-lib.sh that enables
easy recording of input and output from todo.sh (including
annotation of exit status for testing error cases).

Begin to port and re-factor testsuite.txt into smaller
test cases, starting with basic add list functionality
and replace functionality.

Thanks to Philippe Teuwen <phil@teuwen.org> for feedback
and improvements.

Signed-off-by: Emil Sit <sit@emilsit.net>
2009-04-11 22:00:49 -04:00

59 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
test_description='basic add and list functionality
This test just makes sure the basic add and list
command work, including support for filtering.
'
. ./test-lib.sh
#
# Add and list
#
test_todo_session 'basic add/list' <<EOF
>>> todo.sh add notice the daisies
TODO: 'notice the daisies' added on line 1.
>>> todo.sh list
1 notice the daisies
--
TODO: 1 of 1 tasks shown from $HOME/todo.txt
>>> todo.sh add smell the roses
TODO: 'smell the roses' added on line 2.
>>> todo.sh list
1 notice the daisies
2 smell the roses
--
TODO: 2 of 2 tasks shown from $HOME/todo.txt
EOF
#
# Filter
#
test_todo_session 'basic list filtering' <<EOF
>>> todo.sh list daisies
1 notice the daisies
--
TODO: 1 of 2 tasks shown from $HOME/todo.txt
>>> todo.sh list smell
2 smell the roses
--
TODO: 1 of 2 tasks shown from $HOME/todo.txt
EOF
test_todo_session 'case-insensitive filtering' <<EOF
>>> todo.sh add smell the uppercase Roses
TODO: 'smell the uppercase Roses' added on line 3.
>>> todo.sh list roses
2 smell the roses
3 smell the uppercase Roses
--
TODO: 2 of 3 tasks shown from $HOME/todo.txt
EOF
test_done