Thread (1 message) 1 message, 1 author, 2023-06-06

Re: [PATCH] add: check color.ui for interactive add

From: Junio C Hamano <hidden>
Date: 2023-06-06 01:05:30

Junio C Hamano [off-list ref] writes:
quoted
+	test_decode_color <actual.raw >actual &&
It is a minor thing, but for expected output that _wants_ to be
indented in a non-standard way, it would be prudent to protect the
lines from "git apply --whitespace=fix" and in-transit corruption,
perhaps doing something like ...
quoted
+	cat >expect <<-\EOF &&
+	           staged     unstaged path
+	  1:        +3/-0        +2/-1 color-test
+
+	*** Commands ***
... this.

	sed -e "s/^|//" >expect <<-\EOF &&
	|           staged     unstaged path
	|  1:        +3/-0        +2/-1 color-test
	|
	|*** Commands ***

Although this patch does not add such lines, the same principle
applies to expected output lines that _wants_ to have trailing
whitespaces.
Another thing.  We are interested in the configuration to disable
color, so instead of spelling out exact output we expect, which is
brittle when we anticipate that the contents used for the test may
change, wouldn't it work better to ensure that actual.raw and actual
are identical?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help