summaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-04-07 11:35:00 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-04-07 11:35:00 -0300
commit2ad947fe031aa739d98474eb933eede3659305ac (patch)
tree914e41e8ec3e20d5010e27d9cbbe9431c5e6e21c /ltests.c
parentf0cc013afac750ed8ebc79fa3c2413121543ecc7 (diff)
downloadlua-2ad947fe031aa739d98474eb933eede3659305ac.tar.gz
lua-2ad947fe031aa739d98474eb933eede3659305ac.tar.bz2
lua-2ad947fe031aa739d98474eb933eede3659305ac.zip
new test options for luaL_getn/setn
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ltests.c b/ltests.c
index 3f2b724b..71006bb5 100644
--- a/ltests.c
+++ b/ltests.c
@@ -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;