Skip to content

Commit

Permalink
Add test to validate luau fix of debugname
Browse files Browse the repository at this point in the history
  • Loading branch information
kunitoki committed Mar 3, 2024
1 parent af273a8 commit 61f26d0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Tests/Source/NamespaceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,27 @@ TEST_F(NamespaceTests, NamespaceAsRValueReferenceShouldWork)
EXPECT_TRUE(result().isNil());
}

TEST_F(NamespaceTests, BugWithLuauNotPrintingMethodNameInErrors)
{
auto strangelyNamedMethod = [](lua_State* L)
{
luaL_argerror(L, 1, "test message");
return 0;
};

luabridge::getGlobalNamespace(L)
.beginNamespace("foo")
.addFunction("strangelyNamedMethod", strangelyNamedMethod)
.endNamespace();

auto [result, error] = runLuaCaptureError(R"(
local bar = function() foo.strangelyNamedMethod() end
bar()
)");

EXPECT_TRUE(error.find("strangelyNamedMethod") != std::string::npos);
}

#ifdef _M_IX86 // Windows 32bit only

namespace {
Expand Down

0 comments on commit 61f26d0

Please sign in to comment.