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.
15 test_expect_success
'test setup' '
27 test_expect_success
'total help in repo' '
29 tg help tg >"$totalin"
32 test_expect_success
'total help outside repo' '
34 tg help tg >"$totalout"
37 test_expect_success
'total help okay' '
39 test -s "$totalout" &&
40 test_cmp "$totalin" "$totalout"
43 test_expect_success
'full help in repo' '
45 tg help update >"$fullin"
48 test_expect_success
'full help outside repo' '
50 tg help update >"$fullout"
53 test_expect_success
'full help okay' '
56 test_cmp "$fullin" "$fullout"
59 test_expect_success
'brief help in repo' '
61 tg update -h >"$briefin"
64 test_expect_success
'brief help outside repo' '
66 tg update -h >"$briefout"
69 test_expect_success
'brief help okay' '
71 test -s "$briefout" &&
72 test_cmp "$briefin" "$briefout"
75 test_expect_success
'sane help line counts' '
76 test_line_count -ge 1 "$briefout" &&
77 test_line_count -le 5 "$briefout" &&
78 test_line_count -ge 10 "$fullout" &&
79 test_line_count -lt 100 "$fullout" &&
80 test_line_count -gt 1000 "$totalout"