Merge pull request #105 from vbatts/compare_test_openbsd
compare: make the test output more readable
This commit is contained in:
commit
556bb352d2
1 changed files with 7 additions and 1 deletions
|
@ -3,6 +3,7 @@ package mtree
|
||||||
import (
|
import (
|
||||||
"archive/tar"
|
"archive/tar"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"encoding/json"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
@ -443,7 +444,12 @@ func TestTarCompare(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
actualFailure = true
|
actualFailure = true
|
||||||
t.Logf("FAILURE: diff[%d] = %#v", i, delta)
|
buf, err := json.MarshalIndent(delta, "", " ")
|
||||||
|
if err == nil {
|
||||||
|
t.Logf("FAILURE: diff[%d] = %s", i, string(buf))
|
||||||
|
} else {
|
||||||
|
t.Logf("FAILURE: diff[%d] = %#v", i, delta)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if actualFailure {
|
if actualFailure {
|
||||||
|
|
Loading…
Reference in a new issue