1
0
Fork 0
gilo/internal/gilo/point_test.go

29 lines
488 B
Go

package gilo
import "testing"
func TestDefaultPoint(t *testing.T) {
point := DefaultPoint()
if point.X != 0 || point.Y != 0 {
t.Errorf("Failure to create proper Point")
}
}
func TestNewPoint(t *testing.T) {
point := NewPoint(3, 5)
if point.X != 3 || point.Y != 5 {
t.Errorf("Failure to create proper Point")
}
}
func TestPoint_Clone(t *testing.T) {
point := DefaultPoint()
point2 := point.Clone()
if point == point2 {
t.Errorf("Point is identical, not cloned")
}
}