summaryrefslogtreecommitdiff
path: root/t/t0040-parse-options.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-05-05 21:36:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-05-10 19:57:48 (GMT)
commitab6b28b02f4db52ab5bad342592399f2559b4d81 (patch)
tree1fe44b709db0eef9590f63b0de7af6ac257ff71e /t/t0040-parse-options.sh
parentaccac4199c1d28dfd6c860b32d7111c3de8df7a6 (diff)
downloadgit-ab6b28b02f4db52ab5bad342592399f2559b4d81.zip
git-ab6b28b02f4db52ab5bad342592399f2559b4d81.tar.gz
git-ab6b28b02f4db52ab5bad342592399f2559b4d81.tar.bz2
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-xt/t0040-parse-options.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh
index dbaee55..d678fbf 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