lua_pushstring/pushlstring return string

This commit is contained in:
Roberto Ierusalimschy
2007-04-17 10:19:53 -03:00
parent 94d40f3980
commit 619be354c8
3 changed files with 20 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: ltests.c,v 2.40 2006/10/10 17:40:17 roberto Exp roberto $
** $Id: ltests.c,v 2.41 2007/04/10 12:17:52 roberto Exp roberto $
** Internal Module for Debugging of the Lua Implementation
** See Copyright Notice in lua.h
*/
@@ -892,7 +892,8 @@ static int testC (lua_State *L) {
}
else if EQ("tostring") {
const char *s = lua_tostring(L1, getindex);
lua_pushstring(L1, s);
const char *s1 = lua_pushstring(L1, s);
lua_assert((s == NULL && s1 == NULL) || (strcmp)(s, s1) == 0);
}
else if EQ("objsize") {
lua_pushinteger(L1, lua_objlen(L1, getindex));