| 585 | } |
| 586 | |
| 587 | static int DeepLuaErrorFunc(lua_State* L) { |
| 588 | // Create a Lua call stack to show traceback with content |
| 589 | const char *lua_with_callstack = |
| 590 | "function deep_func()\n" |
| 591 | " error(nil)\n" |
| 592 | "end\n" |
| 593 | "function main_func()\n" |
| 594 | " deep_func()\n" |
| 595 | "end\n" |
| 596 | "main_func()\n"; |
| 597 | |
| 598 | // Use loadstring + call instead of dostring to let error propagate |
| 599 | int result = luaL_loadstring(L, lua_with_callstack); |
| 600 | if (result != 0) { |
| 601 | return result; // Compilation error |
| 602 | } |
| 603 | lua_call(L, 0, 0); // This will throw the error from error(nil) |
| 604 | return 0; // Never reached |
| 605 | } |
| 606 | |
| 607 | TEST_F(ScriptTestLua, TestAssertNilNil) |
| 608 | { |
nothing calls this directly
no test coverage detected