mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-20 22:42:39 +08:00
Correct the reversed diff output for all tests
This has been driving nuts for years. The output of the diff emitted when a test fails was always reversed, because the diff tool is called with `${difftool} ${new} ${old}` so all the `-` and `+` contexts are reversed, and the highlights are all screwed up. The output of a `make test` run should show what has changed from the baseline/expected, not how the expected differs from the actual. When considered from both the perspective of intentional changes to the test outputs and failed test outputs, it is desirable to see how the test output has changed from the previously expected, and not the other way around. (If you were used to the previous behavior, I apologize. But it was wrong.)
This commit is contained in:
parent
6cf61d5235
commit
0c5015d467
@ -69,11 +69,11 @@ function test_file
|
||||
say red "fail"
|
||||
if test $out_status -ne 0
|
||||
say yellow "Output differs for file $file. Diff follows:"
|
||||
colordiff -u $file.tmp.out $file.out
|
||||
colordiff -u $file.out $file.tmp.out
|
||||
end
|
||||
if test $err_status -ne 0
|
||||
say yellow "Error output differs for file $file. Diff follows:"
|
||||
colordiff -u $file.tmp.err $file.err
|
||||
colordiff -u $file.err $file.tmp.err
|
||||
end
|
||||
if test $exit_status -ne 0
|
||||
say yellow "Exit status differs for file $file."
|
||||
|
@ -245,10 +245,10 @@ test_file() (
|
||||
mv -f "${test_stderr}.new" "${test_stderr}"
|
||||
|
||||
# Check the results
|
||||
if ! diff "${test_stdout}" "${want_stdout}" >/dev/null 2>/dev/null ; then
|
||||
if ! diff "${want_stdout}" "${test_stdout}" >/dev/null 2>/dev/null ; then
|
||||
out_status=1
|
||||
fi
|
||||
if ! diff "${test_stderr}" "${want_stderr}" >/dev/null 2>/dev/null ; then
|
||||
if ! diff "${want_stderr}" "${test_stderr}" >/dev/null 2>/dev/null ; then
|
||||
err_status=1
|
||||
fi
|
||||
|
||||
@ -264,11 +264,11 @@ test_file() (
|
||||
|
||||
if [ "$out_status" != '0' ] ; then
|
||||
say "$term_yellow" "Output differs for file $file. Diff follows:"
|
||||
"$difftool" -u "${test_stdout}" "${want_stdout}"
|
||||
"$difftool" -u "${want_stdout}" "${test_stdout}"
|
||||
fi
|
||||
if [ "$err_status" != '0' ] ; then
|
||||
say "$term_yellow" "Error output differs for file $file. Diff follows:"
|
||||
"$difftool" -u "${test_stderr}" "${want_stderr}"
|
||||
"$difftool" -u "${want_stderr}" "${test_stderr}"
|
||||
fi
|
||||
rc=1
|
||||
fi
|
||||
|
@ -55,11 +55,11 @@ function test_file
|
||||
say red "fail"
|
||||
if test $out_status -ne 0
|
||||
say yellow "Output differs for file $file. Diff follows:"
|
||||
colordiff -u $base.tmp.out $base.out
|
||||
colordiff -u $base.out $base.tmp.out
|
||||
end
|
||||
if test $err_status -ne 0
|
||||
say yellow "Error output differs for file $file. Diff follows:"
|
||||
colordiff -u $base.tmp.err $base.err
|
||||
colordiff -u $base.err $base.tmp.err
|
||||
end
|
||||
if test $exit_status -ne 0
|
||||
say yellow "Exit status differs for file $file."
|
||||
|
Loading…
x
Reference in New Issue
Block a user