15 lines
372 B
Go
15 lines
372 B
Go
package clock
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestInstantRoundTripUsesUTCUnixMilliseconds(t *testing.T) {
|
|
want := time.Date(2026, time.August, 29, 12, 34, 56, 789000000, time.FixedZone("local", 3*60*60))
|
|
got := FromTime(want).Time()
|
|
if !got.Equal(want.UTC()) || got.Location() != time.UTC {
|
|
t.Fatalf("instant round trip = %v, want %v UTC", got, want.UTC())
|
|
}
|
|
}
|