Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 1/3] remote: add a test for extra arguments, according to docs

From: Thomas Rast <hidden>
Date: 2016-06-15 22:56:59

Junio C Hamano [off-list ref] writes:
Thomas Rast [off-list ref] writes:
quoted
+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 newname
Perhaps 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".
Hmm.  I had that at first, but then the final cleanup would have had to
touch all tests to remove the optional argument, making it noisy.

Anyway, it's probably all a bit over-engineered for only one effective
code change ;-)

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help