1
0
forked from MTSR/mapserver
mapserver/areasparser/parser_test.go

26 lines
289 B
Go
Raw Normal View History

2019-02-22 15:55:11 +03:00
package areasparser
import (
2019-02-22 15:57:33 +03:00
"encoding/json"
"fmt"
"testing"
2019-02-22 15:55:11 +03:00
)
2019-02-22 15:57:33 +03:00
func TestParse(t *testing.T) {
2019-02-22 15:55:11 +03:00
2019-02-22 15:57:33 +03:00
a, err := ParseFile("testdata/areas.dat")
2019-02-22 15:55:11 +03:00
2019-02-22 15:57:33 +03:00
if err != nil {
t.Fatal(err)
}
2019-02-22 15:55:11 +03:00
2019-02-22 15:57:33 +03:00
j, err := json.MarshalIndent(a, "", " ")
2019-02-22 15:55:11 +03:00
2019-02-22 15:57:33 +03:00
if err != nil {
t.Fatal(err)
}
2019-02-22 15:55:11 +03:00
2019-02-22 15:57:33 +03:00
fmt.Println(string(j[:]))
2019-02-22 15:55:11 +03:00
}