acc: Print full paths in case of issues

This commit is contained in:
Denis Bilenko 2025-01-27 21:32:11 +01:00
parent daaf357082
commit a4aa5b89a2
1 changed files with 3 additions and 3 deletions

View File

@ -263,7 +263,7 @@ func doComparison(t *testing.T, repls testdiff.ReplacementsContext, dirRef, dirN
bufRef, okRef := tryReading(t, pathRef)
bufNew, okNew := tryReading(t, pathNew)
if !okRef && !okNew {
t.Errorf("Both files are missing or have errors: %s, %s", pathRef, pathNew)
t.Errorf("Both files are missing or have errors: %s\npathNew: %s\npathRef: %s", relPath, pathRef, pathNew)
return
}
@ -276,7 +276,7 @@ func doComparison(t *testing.T, repls testdiff.ReplacementsContext, dirRef, dirN
// The test did not produce an expected output file.
if okRef && !okNew {
t.Errorf("Missing output file: %s", relPath)
t.Errorf("Missing output file: %s\npathNew: %s\npathRef: %s", relPath, pathNew, pathRef)
testdiff.AssertEqualTexts(t, pathRef, pathNew, valueRef, valueNew)
if testdiff.OverwriteMode {
t.Logf("Removing output file: %s", relPath)
@ -287,7 +287,7 @@ func doComparison(t *testing.T, repls testdiff.ReplacementsContext, dirRef, dirN
// The test produced an unexpected output file.
if !okRef && okNew {
t.Errorf("Unexpected output file: %s", relPath)
t.Errorf("Unexpected output file: %s\npathNew: %s\npathRef: %s", relPath, pathNew, pathRef)
testdiff.AssertEqualTexts(t, pathRef, pathNew, valueRef, valueNew)
if testdiff.OverwriteMode {
t.Logf("Writing output file: %s", relPath)