1
0
forked from MTSR/mapserver
mapserver/server/luaparser/luaparser_test.go
NatureFreshMilk deeefd9a8c lua parser
2019-02-08 13:24:54 +01:00

31 lines
390 B
Go

package luaparser
import (
"testing"
"fmt"
)
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")
}
}