From 4c404c404c281f1872f0283acbaee97657f3e08b Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Sun, 12 Mar 2017 16:01:08 +0100 Subject: [Strings] lapi.js, lcode.js, llex.js, lparser.js --- tests/C/Makefile | 17 ----------------- tests/C/lua_call-jsclosure.c | 30 ------------------------------ tests/C/lua_call.c | 28 ---------------------------- tests/C/lua_pop.c | 24 ------------------------ tests/C/lua_pushboolean.c | 21 --------------------- tests/C/lua_pushcclosure-light.c | 25 ------------------------- tests/C/lua_pushinteger.c | 21 --------------------- tests/C/lua_pushnil.c | 21 --------------------- tests/C/lua_pushnumber.c | 21 --------------------- tests/C/lua_pushstring.c | 21 --------------------- tests/C/lua_pushvalue.c | 24 ------------------------ tests/C/lua_setgettable.c | 31 ------------------------------- 12 files changed, 284 deletions(-) delete mode 100644 tests/C/Makefile delete mode 100644 tests/C/lua_call-jsclosure.c delete mode 100644 tests/C/lua_call.c delete mode 100644 tests/C/lua_pop.c delete mode 100644 tests/C/lua_pushboolean.c delete mode 100644 tests/C/lua_pushcclosure-light.c delete mode 100644 tests/C/lua_pushinteger.c delete mode 100644 tests/C/lua_pushnil.c delete mode 100644 tests/C/lua_pushnumber.c delete mode 100644 tests/C/lua_pushstring.c delete mode 100644 tests/C/lua_pushvalue.c delete mode 100644 tests/C/lua_setgettable.c (limited to 'tests') diff --git a/tests/C/Makefile b/tests/C/Makefile deleted file mode 100644 index 2b753be..0000000 --- a/tests/C/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -CC= gcc-6 -std=gnu99 -CFLAGS= -g -Wall -Wextra - -LIBS= -lm -llua - -all: - $(CC) $(CFLAGS) $(LIBS) lua_pushnil.c -o lua_pushnil.out - $(CC) $(CFLAGS) $(LIBS) lua_pushnumber.c -o lua_pushnumber.out - $(CC) $(CFLAGS) $(LIBS) lua_pushinteger.c -o lua_pushinteger.out - $(CC) $(CFLAGS) $(LIBS) lua_pushstring.c -o lua_pushstring.out - $(CC) $(CFLAGS) $(LIBS) lua_pushboolean.c -o lua_pushboolean.out - $(CC) $(CFLAGS) $(LIBS) lua_pushvalue.c -o lua_pushvalue.out - $(CC) $(CFLAGS) $(LIBS) lua_pushcclosure-light.c -o lua_pushcclosure-light.out - $(CC) $(CFLAGS) $(LIBS) lua_call.c -o lua_call.out - $(CC) $(CFLAGS) $(LIBS) lua_call-jsclosure.c -o lua_call-jsclosure.out - $(CC) $(CFLAGS) $(LIBS) lua_pop.c -o lua_pop.out - $(CC) $(CFLAGS) $(LIBS) lua_setgettable.c -o lua_setgettable.out \ No newline at end of file diff --git a/tests/C/lua_call-jsclosure.c b/tests/C/lua_call-jsclosure.c deleted file mode 100644 index 98fa739..0000000 --- a/tests/C/lua_call-jsclosure.c +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include -#include -#include - -int func(lua_State *L) { - const char *s = lua_tostring(L, lua_upvalueindex(1)); - lua_pushstring(L, s); - return 1; -} - -int main(void) { - - lua_State *L = luaL_newstate(); - - luaL_openlibs(L); - - lua_pushstring(L, "upvalue hello !"); - lua_pushcclosure(L, func, 1); - - lua_call(L, 0, 1); - - printf("Lua returned: %s\n", lua_tostring(L, -1)); - - lua_close(L); - - return 0; - -} \ No newline at end of file diff --git a/tests/C/lua_call.c b/tests/C/lua_call.c deleted file mode 100644 index 3e0e406..0000000 --- a/tests/C/lua_call.c +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include -#include -#include -#include - -int func(lua_State *L) { - lua_pushstring(L, "hello"); - return 1; -} - -int main(void) { - - lua_State *L = luaL_newstate(); - - luaL_openlibs(L); - - lua_pushcfunction(L, func); - - lua_call(L, 0, 1); - - printf("Lua returned: %s\n", lua_tostring(L, -1)); - - lua_close(L); - - return 0; - -} \ No newline at end of file diff --git a/tests/C/lua_pop.c b/tests/C/lua_pop.c deleted file mode 100644 index 06b8ef1..0000000 --- a/tests/C/lua_pop.c +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include -#include -#include -#include - -int main(void) { - - lua_State *L = luaL_newstate(); - - luaL_openlibs(L); - - lua_pushstring(L, "hello"); - lua_pushstring(L, "world"); - - lua_pop(L, 1); - - printf("L->top(%d): %s\n", lua_gettop(L), lua_tostring(L, -1)); - - lua_close(L); - - return 0; - -} \ No newline at end of file diff --git a/tests/C/lua_pushboolean.c b/tests/C/lua_pushboolean.c deleted file mode 100644 index d592691..0000000 --- a/tests/C/lua_pushboolean.c +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include -#include -#include -#include - -int main(void) { - - lua_State *L = luaL_newstate(); - - luaL_openlibs(L); - - lua_pushboolean(L, 1); - - printf("L->top(%d): %s\n", lua_gettop(L), luaL_typename(L, lua_gettop(L))); - - lua_close(L); - - return 0; - -} \ No newline at end of file diff --git a/tests/C/lua_pushcclosure-light.c b/tests/C/lua_pushcclosure-light.c deleted file mode 100644 index a891450..0000000 --- a/tests/C/lua_pushcclosure-light.c +++ /dev/null @@ -1,25 +0,0 @@ -#include -#include -#include -#include -#include - -int func(lua_State *L) { - return 0; -} - -int main(void) { - - lua_State *L = luaL_newstate(); - - luaL_openlibs(L); - - lua_pushcclosure(L, func, 0); - - printf("L->top(%d): %s\n", lua_gettop(L), luaL_typename(L, lua_gettop(L))); - - lua_close(L); - - return 0; - -} \ No newline at end of file diff --git a/tests/C/lua_pushinteger.c b/tests/C/lua_pushinteger.c deleted file mode 100644 index da134b6..0000000 --- a/tests/C/lua_pushinteger.c +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include -#include -#include -#include - -int main(void) { - - lua_State *L = luaL_newstate(); - - luaL_openlibs(L); - - lua_pushinteger(L, 10); - - printf("L->top(%d): type %s, value %ld\n", lua_gettop(L), luaL_typename(L, lua_gettop(L)), lua_tointeger(L, -1)); - - lua_close(L); - - return 0; - -} \ No newline at end of file diff --git a/tests/C/lua_pushnil.c b/tests/C/lua_pushnil.c deleted file mode 100644 index bb31246..0000000 --- a/tests/C/lua_pushnil.c +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include -#include -#include -#include - -int main(void) { - - lua_State *L = luaL_newstate(); - - luaL_openlibs(L); - - lua_pushnil(L); - - printf("L->top(%d): %s\n", lua_gettop(L), luaL_typename(L, lua_gettop(L))); - - lua_close(L); - - return 0; - -} \ No newline at end of file diff --git a/tests/C/lua_pushnumber.c b/tests/C/lua_pushnumber.c deleted file mode 100644 index 697258f..0000000 --- a/tests/C/lua_pushnumber.c +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include -#include -#include -#include - -int main(void) { - - lua_State *L = luaL_newstate(); - - luaL_openlibs(L); - - lua_pushnumber(L, 10.5); - - printf("L->top(%d): %s\n", lua_gettop(L), luaL_typename(L, lua_gettop(L))); - - lua_close(L); - - return 0; - -} \ No newline at end of file diff --git a/tests/C/lua_pushstring.c b/tests/C/lua_pushstring.c deleted file mode 100644 index fc675c7..0000000 --- a/tests/C/lua_pushstring.c +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include -#include -#include -#include - -int main(void) { - - lua_State *L = luaL_newstate(); - - luaL_openlibs(L); - - lua_pushstring(L, "hello"); - - printf("L->top(%d): %s\n", lua_gettop(L), luaL_typename(L, lua_gettop(L))); - - lua_close(L); - - return 0; - -} \ No newline at end of file diff --git a/tests/C/lua_pushvalue.c b/tests/C/lua_pushvalue.c deleted file mode 100644 index 055ee23..0000000 --- a/tests/C/lua_pushvalue.c +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include -#include -#include -#include - -int main(void) { - - lua_State *L = luaL_newstate(); - - luaL_openlibs(L); - - lua_pushstring(L, "hello"); - - lua_pushvalue(L, -1); - - printf("L->top(%d): %s\n", lua_gettop(L), luaL_typename(L, -1)); - printf("L->top - 1(%d): %s\n", lua_gettop(L) - 1, luaL_typename(L, -2)); - - lua_close(L); - - return 0; - -} \ No newline at end of file diff --git a/tests/C/lua_setgettable.c b/tests/C/lua_setgettable.c deleted file mode 100644 index af3d9f8..0000000 --- a/tests/C/lua_setgettable.c +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include -#include -#include -#include - -int main(void) { - - lua_State *L = luaL_newstate(); - - luaL_openlibs(L); - - lua_newtable(L); - - lua_pushstring(L, "key"); - lua_pushstring(L, "value"); - - lua_settable(L, -3); - - lua_pushstring(L, "key"); - lua_gettable(L, -2); - - - printf("L->top(%d): %s\n", lua_gettop(L), luaL_typename(L, -1)); - printf("Table has value: %s\n", lua_tostring(L, -1)); - - lua_close(L); - - return 0; - -} \ No newline at end of file -- cgit v1.2.3-54-g00ecf