From fb114d8dc6810133ba9e10d75fa9887ee169bf5d Mon Sep 17 00:00:00 2001 From: Philipp Janda Date: Sat, 11 Jul 2015 01:14:47 +0200 Subject: luaL_newmetatable sets __name on all Lua versions. --- tests/testmod.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/testmod.c b/tests/testmod.c index c2dc715..2293064 100644 --- a/tests/testmod.c +++ b/tests/testmod.c @@ -205,7 +205,10 @@ static int test_udata (lua_State *L) { (void)u2; lua_pushlightuserdata(L, luaL_testudata(L, u1pos, tname)); lua_pushlightuserdata(L, luaL_testudata(L, u2pos, tname)); - return 2; + luaL_getmetatable(L, "utype1"); + lua_getfield(L, -1, "__name"); + lua_replace(L, -2); + return 3; } static int test_subtable (lua_State *L) { -- cgit v1.2.3-55-g6feb