diff options
| -rw-r--r-- | ltests.c | 12 |
1 files changed, 11 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 1.156 2003/03/19 21:14:53 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.157 2003/04/03 13:35:34 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 | */ |
| @@ -717,6 +717,16 @@ static int testC (lua_State *L) { | |||
| 717 | else if EQ("type") { | 717 | else if EQ("type") { |
| 718 | lua_pushstring(L, lua_typename(L, lua_type(L, getnum))); | 718 | lua_pushstring(L, lua_typename(L, lua_type(L, getnum))); |
| 719 | } | 719 | } |
| 720 | else if EQ("getn") { | ||
| 721 | int i = getnum; | ||
| 722 | lua_pushintegral(L, luaL_getn(L, i)); | ||
| 723 | } | ||
| 724 | else if EQ("setn") { | ||
| 725 | int i = getnum; | ||
| 726 | int n = cast(int, lua_tonumber(L, -1)); | ||
| 727 | luaL_setn(L, i, n); | ||
| 728 | lua_pop(L, 1); | ||
| 729 | } | ||
| 720 | else luaL_error(L, "unknown instruction %s", buff); | 730 | else luaL_error(L, "unknown instruction %s", buff); |
| 721 | } | 731 | } |
| 722 | return 0; | 732 | return 0; |
