diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-05-06 20:17:05 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-05-10 21:57:48 +0200 |
commit | 8ca65aebad55790d675f1eaead2dfc15fae60847 (patch) | |
tree | 2367bdf18e33402414baca0c42401bcce9fbfbab /t/t0040-parse-options.sh | |
parent | t0040: remove unused test helpers (diff) | |
download | git-8ca65aebad55790d675f1eaead2dfc15fae60847.tar.xz git-8ca65aebad55790d675f1eaead2dfc15fae60847.zip |
t0040: convert a few tests to use test-parse-options --expect
As a small example of using "test-parse-options --expect",
rewrite the "check" helper using it, instead of comparing
the whole variable dump.
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 | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh index 5c8c72aa05..db5f60d0c5 100755 --- a/t/t0040-parse-options.sh +++ b/t/t0040-parse-options.sh @@ -57,28 +57,12 @@ test_expect_success 'test help' ' mv expect expect.err -cat >expect.template <<\EOF -boolean: 0 -integer: 0 -magnitude: 0 -timestamp: 0 -string: (not set) -abbrev: 7 -verbose: -1 -quiet: 0 -dry run: no -file: (not set) -EOF - -check() { +check () { what="$1" && shift && expect="$1" && shift && - sed "s/^$what .*/$what $expect/" <expect.template >expect && - test-parse-options $* >output 2>output.err && - test_must_be_empty output.err && - test_cmp expect output + test-parse-options --expect="$what $expect" "$@" } check_unknown_i18n() { |