diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-05-05 14:36:55 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-05-10 12:57:48 -0700 |
commit | ab6b28b02f4db52ab5bad342592399f2559b4d81 (patch) | |
tree | 1fe44b709db0eef9590f63b0de7af6ac257ff71e /t/t0040-parse-options.sh | |
parent | accac4199c1d28dfd6c860b32d7111c3de8df7a6 (diff) | |
download | git-ab6b28b02f4db52ab5bad342592399f2559b4d81.tar.gz |
test-parse-options: --expect=<string> option to simplify tests
Existing tests in t0040 follow a rather verbose pattern:
cat >expect <<\EOF
boolean: 0
integer: 0
magnitude: 0
timestamp: 0
string: (not set)
abbrev: 7
verbose: 0
quiet: 3
dry run: no
file: (not set)
EOF
test_expect_success 'multiple quiet levels' '
test-parse-options -q -q -q >output 2>output.err &&
test_must_be_empty output.err &&
test_cmp expect output
'
But the only thing this test cares about is if "quiet: 3" is in the
output. We should be able to write the above 18 lines with just
four lines, like this:
test_expect_success 'multiple quiet levels' '
test-parse-options --expect="quiet: 3" -q -q -q
'
Teach the new --expect=<string> option to test-parse-options helper.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0040-parse-options.sh')
-rwxr-xr-x | t/t0040-parse-options.sh | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh index dbaee5526a..d678fbf1b7 100755 --- a/t/t0040-parse-options.sh +++ b/t/t0040-parse-options.sh @@ -45,6 +45,7 @@ Standard options -v, --verbose be verbose -n, --dry-run dry run -q, --quiet be quiet + --expect <string> expected output in the variable dump EOF |