mapserver/mapobjectdb/accessor_test.go

32 lines
432 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"
2023-12-29 18:00:11 +03:00
"mapserver/types"
2019-02-06 10:09:21 +03:00
"testing"
)
func TestNewMapBlockCoords(t *testing.T) {
attrs := make(map[string]string)
attrs["X"] = "y"
2023-12-29 18:00:11 +03:00
pos := types.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
}