summaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-05-31 16:41:52 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-05-31 16:41:52 -0300
commit0dfd04eb60a7b9d54a6348ef4d9a3fa3963682aa (patch)
tree7f2353754af0783c2713af728be68878f149b3ce /ltests.c
parent1e0aaf2156bb261787606b8cf00f812d75344ff2 (diff)
downloadlua-0dfd04eb60a7b9d54a6348ef4d9a3fa3963682aa.tar.gz
lua-0dfd04eb60a7b9d54a6348ef4d9a3fa3963682aa.tar.bz2
lua-0dfd04eb60a7b9d54a6348ef4d9a3fa3963682aa.zip
`lua_strlen' upgraded to `lua_objsize' (which also works with userdata)
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/ltests.c b/ltests.c
index 456c9d91..afdfb515 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 2.6 2004/05/10 17:50:51 roberto Exp roberto $ 2** $Id: ltests.c,v 2.7 2004/05/31 18:50:48 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*/
@@ -760,16 +760,6 @@ static int int2fb_aux (lua_State *L) {
760} 760}
761 761
762 762
763static int test_do (lua_State *L) {
764 const char *p = luaL_checkstring(L, 1);
765 if (*p == '@')
766 lua_dofile(L, p+1);
767 else
768 lua_dostring(L, p);
769 return lua_gettop(L);
770}
771
772
773 763
774/* 764/*
775** {====================================================== 765** {======================================================
@@ -858,8 +848,8 @@ static int testC (lua_State *L) {
858 const char *s = lua_tostring(L, getnum); 848 const char *s = lua_tostring(L, getnum);
859 lua_pushstring(L, s); 849 lua_pushstring(L, s);
860 } 850 }
861 else if EQ("strlen") { 851 else if EQ("objsize") {
862 lua_pushinteger(L, lua_strlen(L, getnum)); 852 lua_pushinteger(L, lua_objsize(L, getnum));
863 } 853 }
864 else if EQ("tocfunction") { 854 else if EQ("tocfunction") {
865 lua_pushcfunction(L, lua_tocfunction(L, getnum)); 855 lua_pushcfunction(L, lua_tocfunction(L, getnum));
@@ -1033,7 +1023,6 @@ static const struct luaL_reg tests_funcs[] = {
1033 {"stacklevel", stacklevel}, 1023 {"stacklevel", stacklevel},
1034 {"querystr", string_query}, 1024 {"querystr", string_query},
1035 {"querytab", table_query}, 1025 {"querytab", table_query},
1036 {"doit", test_do},
1037 {"testC", testC}, 1026 {"testC", testC},
1038 {"checkmemory", lua_checkmemory}, 1027 {"checkmemory", lua_checkmemory},
1039 {"gccolor", get_gccolor}, 1028 {"gccolor", get_gccolor},