File: t0001-null.sh

package info (click to toggle)
todotxt-cli 2.11.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 1,312 kB
  • sloc: sh: 5,393; makefile: 67
file content (103 lines) | stat: -rwxr-xr-x 2,106 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash

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 <<EOF
--
TODO: 0 of 0 tasks shown
EOF

test_expect_success 'null ls' '
    todo.sh ls > 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 <<EOF
--
TODO: 0 of 0 tasks shown
DONE: 0 of 0 tasks shown
total 0 of 0 tasks shown
EOF

test_expect_success 'null lsa' '
    todo.sh lsa > 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 <<EOF
TODO: File  does not exist.
EOF
# XXX really should give a better usage error message here.
test_expect_success 'null lf' '
    todo.sh lf > output || test_cmp expect output
'
test_expect_success 'null listfile' '
    todo.sh listfile > output || test_cmp expect output
'
cat > expect <<EOF
TODO: File foo.txt does not exist.
EOF
test_expect_success 'null listfile foo.txt' '
    todo.sh listfile foo.txt > output || test_cmp expect output
'

test_done