tests: Add tests to validate listcon and listproj.
Two basic tests to ensure that listcon and listproj function as expected. Signed-off-by: Emil Sit <sit@emilsit.net>
This commit is contained in:
58
tests/t1310-listcon.sh
Executable file
58
tests/t1310-listcon.sh
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
|
||||
test_description='listcon functionality
|
||||
|
||||
This test checks basic context listing functionality
|
||||
'
|
||||
. ./test-lib.sh
|
||||
|
||||
cat > todo.txt <<EOF
|
||||
item 1
|
||||
item 2
|
||||
item 3
|
||||
EOF
|
||||
test_expect_success 'listcon no contexts' '
|
||||
todo.sh listcon > output && ! test -s output
|
||||
'
|
||||
|
||||
cat > todo.txt <<EOF
|
||||
(A) @1 -- Some context 1 task, whitespace, one char
|
||||
(A) @c2 -- Some context 2 task, whitespace, two char
|
||||
@con03 -- Some context 3 task, no whitespace
|
||||
@con04 -- Some context 4 task, no whitespace
|
||||
@con05@con06 -- weird context
|
||||
EOF
|
||||
test_todo_session 'Single context per line' <<EOF
|
||||
>>> todo.sh listcon
|
||||
@1
|
||||
@c2
|
||||
@con03
|
||||
@con04
|
||||
@con05@con06
|
||||
EOF
|
||||
|
||||
cat > todo.txt <<EOF
|
||||
@con01 -- Some context 1 task
|
||||
@con02 -- Some context 2 task
|
||||
@con02 @con03 -- Multi-context task
|
||||
EOF
|
||||
test_todo_session 'Multi-context per line' <<EOF
|
||||
>>> todo.sh listcon
|
||||
@con01
|
||||
@con02
|
||||
@con03
|
||||
EOF
|
||||
|
||||
cat > todo.txt <<EOF
|
||||
@con01 -- Some context 1 task
|
||||
@con02 -- Some context 2 task
|
||||
@con02 ginatrapani@gmail.com -- Some context 2 task
|
||||
EOF
|
||||
test_todo_session 'listcon e-mail address test' <<EOF
|
||||
>>> todo.sh listcon
|
||||
@con01
|
||||
@con02
|
||||
EOF
|
||||
|
||||
test_done
|
||||
58
tests/t1320-listproj.sh
Executable file
58
tests/t1320-listproj.sh
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
|
||||
test_description='listproj functionality
|
||||
|
||||
This test checks basic project listing functionality
|
||||
'
|
||||
. ./test-lib.sh
|
||||
|
||||
cat > todo.txt <<EOF
|
||||
item 1
|
||||
item 2
|
||||
item 3
|
||||
EOF
|
||||
test_expect_success 'listproj no projects' '
|
||||
todo.sh listproj > output && ! test -s output
|
||||
'
|
||||
|
||||
cat > todo.txt <<EOF
|
||||
(A) +1 -- Some project 1 task, whitespace, one char
|
||||
(A) +p2 -- Some project 2 task, whitespace, two char
|
||||
+prj03 -- Some project 3 task, no whitespace
|
||||
+prj04 -- Some project 4 task, no whitespace
|
||||
+prj05+prj06 -- weird project
|
||||
EOF
|
||||
test_todo_session 'Single project per line' <<EOF
|
||||
>>> todo.sh listproj
|
||||
+1
|
||||
+p2
|
||||
+prj03
|
||||
+prj04
|
||||
+prj05+prj06
|
||||
EOF
|
||||
|
||||
cat > todo.txt <<EOF
|
||||
+prj01 -- Some project 1 task
|
||||
+prj02 -- Some project 2 task
|
||||
+prj02 +prj03 -- Multi-project task
|
||||
EOF
|
||||
test_todo_session 'Multi-project per line' <<EOF
|
||||
>>> todo.sh listproj
|
||||
+prj01
|
||||
+prj02
|
||||
+prj03
|
||||
EOF
|
||||
|
||||
cat > todo.txt <<EOF
|
||||
+prj01 -- Some project 1 task
|
||||
+prj02 -- Some project 2 task
|
||||
+prj02 ginatrapani+todo@gmail.com -- Some project 2 task
|
||||
EOF
|
||||
test_todo_session 'listproj embedded + test' <<EOF
|
||||
>>> todo.sh listproj
|
||||
+prj01
|
||||
+prj02
|
||||
EOF
|
||||
|
||||
test_done
|
||||
Reference in New Issue
Block a user