MCPcopy Index your code
hub / github.com/Shopify/go-lua / protectedTestParser

Function protectedTestParser

parser_test.go:67–86  ·  view source on GitHub ↗
(l *State, t *testing.T, source string)

Source from the content-addressed store, hash-verified

65}
66
67func protectedTestParser(l *State, t *testing.T, source string) {
68 defer func() {
69 if x := recover(); x != nil {
70 t.Error(x)
71 t.Log(string(debug.Stack()))
72 }
73 }()
74 t.Log("Compiling " + source)
75 binary := strings.TrimSuffix(source, ".lua") + ".bin"
76 if err := exec.Command("luac", "-o", binary, source).Run(); err != nil {
77 t.Fatalf("luac failed to compile %s: %s", source, err)
78 }
79 t.Log("Parsing " + source)
80 bin := load(l, t, binary)
81 l.Pop(1)
82 src := load(l, t, source)
83 l.Pop(1)
84 t.Log(source)
85 compareClosures(t, src, bin)
86}
87
88func expectEqual(t *testing.T, x, y interface{}, m string) {
89 if x != y {

Callers 1

TestParserExhaustivelyFunction · 0.85

Calls 4

loadFunction · 0.85
compareClosuresFunction · 0.85
PopMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected