lsjson: use exactly the correct number of decimal places in the seconds

This commit is contained in:
Nick Craig-Wood
2019-02-03 11:01:52 +00:00
parent da90069462
commit 2135879dda
3 changed files with 43 additions and 9 deletions

View File

@@ -175,7 +175,7 @@ func TestRcList(t *testing.T) {
assert.Equal(t, 2, len(list))
checkFile1 := func(got *operations.ListJSONItem) {
assert.WithinDuration(t, t1, time.Time(got.ModTime), time.Second)
assert.WithinDuration(t, t1, got.ModTime.When, time.Second)
assert.Equal(t, "a", got.Path)
assert.Equal(t, "a", got.Name)
assert.Equal(t, int64(1), got.Size)
@@ -209,7 +209,7 @@ func TestRcList(t *testing.T) {
checkSubdir(list[1])
checkFile2 := func(got *operations.ListJSONItem) {
assert.WithinDuration(t, t2, time.Time(got.ModTime), time.Second)
assert.WithinDuration(t, t2, got.ModTime.When, time.Second)
assert.Equal(t, "subdir/b", got.Path)
assert.Equal(t, "b", got.Name)
assert.Equal(t, int64(2), got.Size)