github.com/hirochachacha/plua@v0.0.0-20170217012138-c82f520cc725/compiler/codegen/codegen_test.go (about) 1 package codegen_test 2 3 import ( 4 "testing" 5 6 "github.com/hirochachacha/plua/compiler/codegen" 7 "github.com/hirochachacha/plua/compiler/parser" 8 "github.com/hirochachacha/plua/object" 9 ) 10 11 func TestGenerate(t *testing.T) { 12 ast, err := parser.ParseFile("testdata/test.lua", 0) 13 if err != nil { 14 panic(err) 15 } 16 17 proto, err := codegen.Generate(ast) 18 if err != nil { 19 panic(err) 20 } 21 22 object.PrintProto(proto) 23 }