(l *lua.State, t *testing.T)
| 42 | } |
| 43 | |
| 44 | func openTestingLibrary(l *lua.State, t *testing.T) { |
| 45 | open := func(l *lua.State) int { |
| 46 | lua.NewLibrary(l, []lua.RegistryFunction{ |
| 47 | {"error", error_(t)}, |
| 48 | {"errorf", errorf(t)}, |
| 49 | {"fatal", fatal(t)}, |
| 50 | {"fatalf", fatalf(t)}, |
| 51 | {"log", log(t)}, |
| 52 | {"logf", logf(t)}, |
| 53 | }) |
| 54 | return 1 |
| 55 | } |
| 56 | lua.Require(l, "goluago/testing", open, false) |
| 57 | l.Pop(1) |
| 58 | } |
| 59 | |
| 60 | func error_(t *testing.T) lua.Function { |
| 61 | return func(l *lua.State) int { |