INNER CODE UNIT · Go
TestConfig_Timestamp
samsara/samsara · clients/go/config_test.go:97
func TestConfig_Timestamp(t *testing.T) {
now := Timestamp()
time.Sleep(1 * time.Millisecond)
later := Timestamp()
if now >= later {
t.Errorf("Real ticking timestamp should be returned. Expected %d > %d", later, now)
}
if len(strconv.Itoa(int(now))) != 13 {
t.Errorf("Timestamp should be in milliseconds. Got %d", now)
}
}