Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
t0040: convert a few tests to use test-parse-options --expect
author
Junio C Hamano
<gitster@pobox.com>
Fri, 6 May 2016 18:17:05 +0000
(11:17 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 10 May 2016 19:57:48 +0000
(12:57 -0700)
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>
t/t0040-parse-options.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
32d51d4
)
diff --git
a/t/t0040-parse-options.sh
b/t/t0040-parse-options.sh
index 5c8c72aa050087f8e118e910a1c1d6c52276ade8..db5f60d0c5882fc491ca571eb6385554148bbf3a 100755
(executable)
--- 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
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 &&
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() {
}
check_unknown_i18n() {