From 9c3b3f82fe1b0942183ddeef2e16d60bab4f4c06 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 16 May 2002 11:59:49 -0300 Subject: [PATCH] new commands to test `load' --- ltests.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ltests.c b/ltests.c index 69b82dd7..02b74eb2 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 1.120 2002/05/06 19:05:10 roberto Exp roberto $ +** $Id: ltests.c,v 1.121 2002/05/13 13:10:04 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -638,8 +638,13 @@ static int testC (lua_State *L) { int nres = getnum; lua_call(L, narg, nres); } - else if EQ("dostring") { - lua_dostring(L, luaL_check_string(L, getnum)); + else if EQ("loadstring") { + size_t sl; + const char *s = luaL_check_lstr(L, getnum, &sl); + lua_loadbuffer(L, s, sl, s); + } + else if EQ("loadfile") { + lua_loadfile(L, luaL_check_string(L, getnum)); } else if EQ("setmetatable") { lua_setmetatable(L, getnum);