Re: [PATCH 1/3] remote: add a test for extra arguments, according to docs
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 24, 2013, 21:37 UTC
- Message-ID
- <7vhaiva9u5.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <372aa93e4a7a3583730c02543583ce93e095ec64.1366811347.git.trast@inf.ethz.ch>
Thomas Rast <trast@inf.ethz.ch> writes:
Show 14 quoted lines
> +test_extra_arg () {
> + expect="success"
> + if test "z$1" = "z-f"; then
> + expect=failure
> + shift
> + fi
> + test_expect_$expect "extra args: $*" "
> + test_must_fail git remote $* bogus_extra_arg 2>actual &&
> + grep '^usage:' actual
> + "
> +}
> +
> +test_extra_arg -f add nick url
> +test_extra_arg rename origin newnamePerhaps just a taste in readability thing, but I would prefer to see them more like
test_extra_arg_expect failure add nick url test_extra_arg_expect success rename origin newname
than misunderstanding-inviting "-f" that often stands for "--force".
Other than that, the whole series was a pleasant read. Thanks.
Show 9 quoted lines
> +test_extra_arg remove origin > +test_extra_arg set-head origin master > +# set-branches takes any number of args > +test_extra_arg set-url origin newurl oldurl > +test_extra_arg -f show origin > +test_extra_arg -f prune origin > +# update takes any number of args > + > test_done