1
0
forked from MTSR/mapserver
mapserver/mapblockparser/parse_test.go
2019-01-07 08:59:06 +01:00

35 lines
563 B
Go

package mapblockparser
import (
"testing"
"io/ioutil"
"strconv"
log "github.com/sirupsen/logrus"
)
func TestParse(t *testing.T){
log.SetLevel(log.DebugLevel)
data, err := ioutil.ReadFile("testdata/0.0.0")
if err != nil {
t.Error(err)
}
mapblock, err := 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")
}
}