github.com/hirochachacha/plua@v0.0.0-20170217012138-c82f520cc725/compiler/parser/parse_test.go (about) 1 package parser_test 2 3 import ( 4 "path/filepath" 5 "testing" 6 7 "github.com/hirochachacha/plua/compiler/parser" 8 ) 9 10 func TestParseFile(t *testing.T) { 11 matches, err := filepath.Glob("testdata/*.lua") 12 if err != nil { 13 t.Fatal(err) 14 } 15 for _, fname := range matches { 16 if fname == "testdata/example.lua" { 17 continue 18 } 19 20 ast, err := parser.ParseFile(fname, 0) 21 if err != nil { 22 t.Error(err) 23 } 24 25 _ = ast 26 27 // printer.PrintTree(ast) 28 } 29 }