예제 #1
0
파일: clock_test.go 프로젝트: emersion/miko
func TestTimeToTimestamp(test *testing.T) {
	t := time.Unix(789697858, 137569000)
	expected := message.Timestamp(789697858137569)
	timestamp := message.TimeToTimestamp(t)

	if timestamp != expected {
		test.Error("Expected", expected, "but got", timestamp)
	}
}
예제 #2
0
파일: clock_test.go 프로젝트: emersion/miko
func TestTimestampToTime(test *testing.T) {
	timestamp := message.Timestamp(807656789876568412)
	expected := time.Unix(807656789876, 568412000)
	t := message.TimestampToTime(timestamp)

	if t != expected {
		test.Error("Expected", expected, "but got", t)
	}
}