From 92a0d4c67fb962679559c6bce67ab57280a99f3e Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 12 Jun 2008 11:20:49 -0300 Subject: [PATCH] extra options in 'testC' for newmetatable and testudata --- ltests.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ltests.c b/ltests.c index 37d26927..bca00795 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 2.47 2008/02/19 18:55:09 roberto Exp roberto $ +** $Id: ltests.c,v 2.48 2008/04/02 17:38:54 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -1010,6 +1010,13 @@ static int testC (lua_State *L) { if (!lua_checkstack(L1, getnum)) luaL_error(L, "C stack overflow"); } + else if EQ("newmetatable") { + lua_pushboolean(L1, luaL_newmetatable(L1, getname)); + } + else if EQ("testudata") { + int i = getindex; + lua_pushboolean(L1, luaL_testudata(L1, i, getname) != NULL); + } else if EQ("throw") { #if defined(__cplusplus) static struct X { int x; } x;