3 test_description
='tg help commands work anywhere
5 It should be possible to, for example, use `tg tag -h` outside a Git
6 repository without error.
13 GIT_CEILING_DIRECTORIES
="$PWD" && export GIT_CEILING_DIRECTORIES
17 test_expect_success
'test setup' '
29 test_expect_success
'total help in repo' '
31 tg help tg >"$totalin"
34 test_expect_success
'total help outside repo' '
36 tg help tg >"$totalout"
39 test_expect_success
'total help okay' '
41 test -s "$totalout" &&
42 test_cmp "$totalin" "$totalout"
45 test_expect_success
'full help in repo' '
47 tg help update >"$fullin"
50 test_expect_success
'full help outside repo' '
52 tg help update >"$fullout"
55 test_expect_success
'full help okay' '
58 test_cmp "$fullin" "$fullout"
61 test_expect_success
'brief help in repo' '
63 tg update -h >"$briefin"
66 test_expect_success
'brief help outside repo' '
68 tg update -h >"$briefout"
71 test_expect_success
'brief help okay' '
73 test -s "$briefout" &&
74 test_cmp "$briefin" "$briefout"
77 test_expect_success
'sane help line counts' '
78 test_line_count -ge 1 "$briefout" &&
79 test_line_count -le 5 "$briefout" &&
80 test_line_count -ge 10 "$fullout" &&
81 test_line_count -lt 100 "$fullout" &&
82 test_line_count -gt 1000 "$totalout"