1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2024-11-24 17:15:40 +00:00

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 <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2017-06-15 22:54:59 -05:00
parent bc45166bfc
commit 9533b02a8e

View file

@ -1,6 +1,7 @@
package mtree package mtree
import ( import (
"encoding/json"
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
@ -8,7 +9,7 @@ import (
"time" "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 // 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 // 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) t.Fatal(err)
} }
if len(res) > 0 { if len(res) > 0 {
buf, err := json.MarshalIndent(res, "", " ")
if err != nil {
t.Errorf("%#v", res) t.Errorf("%#v", res)
} else {
t.Errorf("%s", buf)
}
} }
} }