37 lines
608 B
Go
37 lines
608 B
Go
package clockface
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
package clockface
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
"git.nerdfortress.dev/mitch/clockface"
|
|
)
|
|
|
|
func TestSecondHandAtMidnight(t *testing.T) {
|
|
tm := time.Date(1337, time.January, 1, 0, 0, 0, 0, time.UTC)
|
|
|
|
want := Point{X: 150, Y: 150 - 90}
|
|
got := SecondHand(tm)
|
|
|
|
if got != want {
|
|
t.Errorf("Got %v, want %v", got, want)
|
|
}
|
|
}
|
|
|
|
func TestSecondHandAt30Seconds(t *testing.T) {
|
|
tm := time.Date(1337, time.January, 1, 0, 0, 30, 0, time.UTC)
|
|
|
|
want := Point{X: 150, Y: 150 + 90}
|
|
got := SecondHand(tm)
|
|
|
|
if got != want {
|
|
t.Errorf("Got %v, wanted %v", got, want)
|
|
}
|
|
}
|