From 9533b02a8ebfc912130843826901a7090932cd87 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 15 Jun 2017 22:54:59 -0500 Subject: [PATCH] fseval: not nanosecond for mock test while testing on osx, it seems that it doesn't support nanoseconds so it fails this check because the mockFsEval returns the nsec precision, but the actual expected results is: "old": "1337888911.288518233" "new": "1337888911.000000000" Ideally there will be a way to detect when the fs supports nsecs Signed-off-by: Vincent Batts --- fseval_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fseval_test.go b/fseval_test.go index 36a3552..d3d6128 100644 --- a/fseval_test.go +++ b/fseval_test.go @@ -1,6 +1,7 @@ package mtree import ( + "encoding/json" "io/ioutil" "os" "path/filepath" @@ -8,7 +9,7 @@ import ( "time" ) -var mockTime = time.Unix(1337888823, 88288518233) +var mockTime = time.Unix(1337888823, 0) // Here be some dodgy testing. In particular, we have to mess around with some // of the FsEval functions. In particular, we change all of the FileInfos to a @@ -155,6 +156,11 @@ func TestCheckFsEval(t *testing.T) { t.Fatal(err) } if len(res) > 0 { - t.Errorf("%#v", res) + buf, err := json.MarshalIndent(res, "", " ") + if err != nil { + t.Errorf("%#v", res) + } else { + t.Errorf("%s", buf) + } } }