summaryrefslogtreecommitdiff
path: root/integrationtests/fileutils.go
diff options
context:
space:
mode:
Diffstat (limited to 'integrationtests/fileutils.go')
-rw-r--r--integrationtests/fileutils.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/integrationtests/fileutils.go b/integrationtests/fileutils.go
index 8ab66a0..1a55732 100644
--- a/integrationtests/fileutils.go
+++ b/integrationtests/fileutils.go
@@ -8,6 +8,7 @@ import (
"io/ioutil"
"os"
"os/exec"
+ "strings"
"testing"
)
@@ -78,10 +79,12 @@ func compareFiles(t *testing.T, fileA, fileB string) error {
shaFileB := shaOfFile(t, fileB)
if shaFileA != shaFileB {
- t.Errorf("Expected SHA %s but got %s", shaFileA, shaFileB)
+ var sb strings.Builder
+ sb.WriteString(fmt.Sprintf("Expected SHA %s but got %s:\n", shaFileA, shaFileB))
if bytes, err := exec.Command("diff", "-u", fileA, fileB).Output(); err != nil {
- return fmt.Errorf(string(bytes))
+ sb.Write(bytes)
}
+ return fmt.Errorf(sb.String())
}
return nil