mapserver/server/mapobjectdb/accessor_test.go

32 lines
434 B
Go
Raw Normal View History

2019-02-06 10:09:21 +03:00
package mapobjectdb
import (
2019-02-07 10:02:13 +03:00
"fmt"
2019-02-06 10:09:21 +03:00
"mapserver/coords"
"testing"
)
func TestNewMapBlockCoords(t *testing.T) {
attrs := make(map[string]string)
attrs["X"] = "y"
pos := coords.NewMapBlockCoords(1, 2, 3)
2019-02-07 10:02:13 +03:00
fmt.Println(pos)
2019-02-06 10:09:21 +03:00
2019-02-07 10:02:13 +03:00
obj := NewMapObject(pos, 10, 12, 14, "xy")
fmt.Println(obj)
2019-02-06 10:09:21 +03:00
2019-02-07 10:02:13 +03:00
if obj.X != 26 {
t.Error("x coord off")
}
2019-02-06 10:09:21 +03:00
2019-02-07 10:02:13 +03:00
if obj.Y != 44 {
t.Error("Y coord off")
}
2019-02-06 10:09:21 +03:00
2019-02-07 10:02:13 +03:00
if obj.Z != 62 {
t.Error("Z coord off")
}
2019-02-06 10:09:21 +03:00
}