diff --git a/tests/t0001-null.sh b/tests/t0001-null.sh new file mode 100755 index 0000000..acfc01b --- /dev/null +++ b/tests/t0001-null.sh @@ -0,0 +1,101 @@ +#!/bin/sh + +test_description='todo.sh basic null functionality test. + +This test just makes sure the basic commands work, +when there are no todos. +' +. ./test-lib.sh + +# +# ls|list +# +cat > expect < output && test_cmp expect output +' +test_expect_success 'null list' ' + todo.sh list > output && test_cmp expect output +' +test_expect_success 'null list filter' ' + todo.sh list filter > output && test_cmp expect output +' + +# +# lsp|listpri +# +# Re-use expect from ls. +test_expect_success 'null lsp' ' + todo.sh lsp > output && test_cmp expect output +' +test_expect_success 'null listpri' ' + todo.sh listpri > output && test_cmp expect output +' +test_expect_success 'null listpri a' ' + todo.sh listpri a > output && test_cmp expect output +' + +# +# lsa|listall +# +cat > expect < output && test_cmp expect output +' +test_expect_success 'null list' ' + todo.sh listall > output && test_cmp expect output +' +test_expect_success 'null list filter' ' + todo.sh listall filter > output && test_cmp expect output +' + + +# +# lsc|listcon +# +test_expect_success 'null lsc' ' + todo.sh lsc > output && ! test -s output +' +test_expect_success 'null listcon' ' + todo.sh listcon > output && ! test -s output +' + +# +# lsprj|listproj +# +test_expect_success 'null lsprj' ' + todo.sh lsprj > output && ! test -s output +' +test_expect_success 'null listproj' ' + todo.sh listproj > output && ! test -s output +' + +# +# lf|listfile +# +cat > expect < output || test_cmp expect output +' +test_expect_success 'null listfile' ' + todo.sh listfile > output || test_cmp expect output +' +cat > expect < output || test_cmp expect output +' + +test_done