(t *testing.T)
| 17 | } |
| 18 | |
| 19 | func TestParser(t *testing.T) { |
| 20 | l := NewState() |
| 21 | OpenLibraries(l) |
| 22 | bin := load(l, t, "fixtures/fib.bin") |
| 23 | l.Pop(1) |
| 24 | closure := load(l, t, "fixtures/fib.lua") |
| 25 | p := closure.prototype |
| 26 | if p == nil { |
| 27 | t.Fatal("prototype was nil") |
| 28 | } |
| 29 | validate("@fixtures/fib.lua", p.source, "as source file name", t) |
| 30 | if !p.isVarArg { |
| 31 | t.Error("expected main function to be var arg, but wasn't") |
| 32 | } |
| 33 | if len(closure.upValues) != len(closure.prototype.upValues) { |
| 34 | t.Error("upvalue count doesn't match", len(closure.upValues), "!=", len(closure.prototype.upValues)) |
| 35 | } |
| 36 | compareClosures(t, bin, closure) |
| 37 | l.Call(0, 0) |
| 38 | } |
| 39 | |
| 40 | func TestEmptyString(t *testing.T) { |
| 41 | l := NewState() |
nothing calls this directly
no test coverage detected
searching dependent graphs…