utils: Initialise Clock with go defaults in TestClockSet

Changed to be more idiomatic, addresses PR feedback.
This commit is contained in:
Alex Willmer 2020-03-29 19:20:28 +01:00
parent 52e3d427a1
commit 8f54a7c1d8
1 changed files with 3 additions and 3 deletions

View File

@ -6,12 +6,12 @@ import (
)
func TestClockSet(t *testing.T) {
clock := Clock{false, time.Unix(1000000, 0)}
clock.Set(time.Unix(0, 0))
clock := Clock{}
clock.Set(time.Unix(1000000, 0))
if clock.faked == false {
t.Error("Fake time was set, but .faked flag was not set")
}
if !clock.Time().Equal(time.Unix(0, 0)) {
if !clock.Time().Equal(time.Unix(1000000, 0)) {
t.Error("Fake time was set, but not returned")
}
}