1
0
forked from MTSR/mapserver
mapserver/mapblockparser/parse_test.go
2019-01-05 21:35:20 +01:00

33 lines
556 B
Go

package mapblockparser
import (
"testing"
"io/ioutil"
"strconv"
mapblockparser "mapserver/mapblockparser"
)
func TestParse(t *testing.T){
data, err := ioutil.ReadFile("testdata/0.0.0")
if err != nil {
t.Error(err)
}
mapblock, err := mapblockparser.Parse(data)
if err != nil {
t.Error(err)
}
if mapblock.Version != 28 {
t.Error("wrong mapblock version: " + strconv.Itoa(int(mapblock.Version)))
}
if !mapblock.Underground {
t.Error("Underground flag")
}
if len(mapblock.Mapdata) != 16384 {
t.Error("Mapdata length wrong")
}
}