Skip to content

Commit

Permalink
tests(fix): output of test cases expected to fail always differs from…
Browse files Browse the repository at this point in the history
… the expected output because of paths
  • Loading branch information
mbideau committed May 7, 2023
1 parent d1928aa commit 8683c91
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/run_some_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ find "$cases_dir" -maxdepth 1 -type d -not -path "$cases_dir" | while read -r ca
if [ "$failed" != 'true' ]; then
echo "$case_name: FAIL (should have failed but did not)'"
expectations_matched=false
elif ! diff -q "$case_exp" "$tmp_err" >/dev/null 2>&1; then
echo "$case_name: FAIL (expected file '$(basename "$case_exp")' differs)'"
expectations_matched=false
if [ "$DEBUG" = 'true' ]; then
diff --color=always "$case_exp" "$tmp_err" | sed 's/^/[DEBUG] /' >&2
else
sed "s|$project_dir/\?||g" -i "$tmp_err" # normalize paths
if ! diff -q "$case_exp" "$tmp_err" >/dev/null 2>&1; then
echo "$case_name: FAIL (expected file '$(basename "$case_exp")' differs)'"
expectations_matched=false
if [ "$DEBUG" = 'true' ]; then
diff --color=always "$case_exp" "$tmp_err" | sed 's/^/[DEBUG] /' >&2
fi
fi
fi
elif [ "$failed" = 'true' ]; then
Expand Down

0 comments on commit 8683c91

Please sign in to comment.