1
0
forked from MTSR/mapserver
mapserver/server/luaparser/luaparser_test.go
NatureFreshMilk 582c7b06b8 go fmt
2019-02-08 16:02:24 +01:00

31 lines
370 B
Go

package luaparser
import (
"fmt"
"testing"
)
func TestParse(t *testing.T) {
p := New()
m, err := p.ParseMap(`return {a=1, b=true, c="abc"}`)
if err != nil {
panic(err)
}
fmt.Println(m)
if m["a"].(int) != 1 {
t.Fatal("parsing error")
}
if !m["b"].(bool) {
t.Fatal("parsing error")
}
if m["c"].(string) != "abc" {
t.Fatal("parsing error")
}
}