diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-16 11:59:49 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-16 11:59:49 -0300 |
commit | 9c3b3f82fe1b0942183ddeef2e16d60bab4f4c06 (patch) | |
tree | 7994fca0f197b399ea6c0e59815594383e5e48f2 | |
parent | b7a0503c1d72603b8f7e480f2abecbc05348cb69 (diff) | |
download | lua-9c3b3f82fe1b0942183ddeef2e16d60bab4f4c06.tar.gz lua-9c3b3f82fe1b0942183ddeef2e16d60bab4f4c06.tar.bz2 lua-9c3b3f82fe1b0942183ddeef2e16d60bab4f4c06.zip |
new commands to test `load'
-rw-r--r-- | ltests.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 1.120 2002/05/06 19:05:10 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.121 2002/05/13 13:10:04 roberto Exp roberto $ |
3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -638,8 +638,13 @@ static int testC (lua_State *L) { | |||
638 | int nres = getnum; | 638 | int nres = getnum; |
639 | lua_call(L, narg, nres); | 639 | lua_call(L, narg, nres); |
640 | } | 640 | } |
641 | else if EQ("dostring") { | 641 | else if EQ("loadstring") { |
642 | lua_dostring(L, luaL_check_string(L, getnum)); | 642 | size_t sl; |
643 | const char *s = luaL_check_lstr(L, getnum, &sl); | ||
644 | lua_loadbuffer(L, s, sl, s); | ||
645 | } | ||
646 | else if EQ("loadfile") { | ||
647 | lua_loadfile(L, luaL_check_string(L, getnum)); | ||
643 | } | 648 | } |
644 | else if EQ("setmetatable") { | 649 | else if EQ("setmetatable") { |
645 | lua_setmetatable(L, getnum); | 650 | lua_setmetatable(L, getnum); |