public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
* [PATCH olang] tests: fix diff error output
@ 2024-09-25 18:39 Carlos Maniero
  2024-09-25 18:39 ` [olang/patches/.build.yml] build success builds.sr.ht
  2024-09-25 21:28 ` [PATCH olang] tests: fix diff error output Johnny Richard
  0 siblings, 2 replies; 3+ messages in thread
From: Carlos Maniero @ 2024-09-25 18:39 UTC (permalink / raw)
  To: ~johnnyrichard/olang-devel; +Cc: Carlos Maniero

When passing the expected file instead of the actual file as first
argument on the diff, it provides a more clear output. Given that the
application returned a new line that the test was not expecting it was
returning the follow output:

- new line (in red)

When it is easier to understand the error when it shows as:

+ new line (in green)

Signed-off-by: Carlos Maniero <carlos@maniero.me>
---
 tests/olc/run.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/olc/run.sh b/tests/olc/run.sh
index 529f0f5..503f960 100755
--- a/tests/olc/run.sh
+++ b/tests/olc/run.sh
@@ -108,7 +108,7 @@ diff_output() {
   fi
 
   print_failed "match failed"
-  diff "$actual_file" "$expected_file" -u --color
+  diff "$expected_file" "$actual_file" -u --color
   exit 1
 }
 

base-commit: 75cfabf7da32ae460c6ecb4d4a705f4705fc2c86
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-25 19:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-25 18:39 [PATCH olang] tests: fix diff error output Carlos Maniero
2024-09-25 18:39 ` [olang/patches/.build.yml] build success builds.sr.ht
2024-09-25 21:28 ` [PATCH olang] tests: fix diff error output Johnny Richard

Code repositories for project(s) associated with this public inbox

	https://git.johnnyrichard.com/olang.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox