summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-03-12 16:01:08 +0100
committerBenoit Giannangeli <giann@users.noreply.github.com>2017-03-13 11:03:24 +0100
commit4c404c404c281f1872f0283acbaee97657f3e08b (patch)
treea347635408110a0219e494876d9e54542175a645 /tests
parent632cf08572b35e8a350ac8b1f9d5bf77fb4e7b95 (diff)
downloadfengari-4c404c404c281f1872f0283acbaee97657f3e08b.tar.gz
fengari-4c404c404c281f1872f0283acbaee97657f3e08b.tar.bz2
fengari-4c404c404c281f1872f0283acbaee97657f3e08b.zip
[Strings] lapi.js, lcode.js, llex.js, lparser.js
Diffstat (limited to 'tests')
-rw-r--r--tests/C/Makefile17
-rw-r--r--tests/C/lua_call-jsclosure.c30
-rw-r--r--tests/C/lua_call.c28
-rw-r--r--tests/C/lua_pop.c24
-rw-r--r--tests/C/lua_pushboolean.c21
-rw-r--r--tests/C/lua_pushcclosure-light.c25
-rw-r--r--tests/C/lua_pushinteger.c21
-rw-r--r--tests/C/lua_pushnil.c21
-rw-r--r--tests/C/lua_pushnumber.c21
-rw-r--r--tests/C/lua_pushstring.c21
-rw-r--r--tests/C/lua_pushvalue.c24
-rw-r--r--tests/C/lua_setgettable.c31
12 files changed, 0 insertions, 284 deletions
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 <lua.h>
-#include <lualib.h>
-#include <lauxlib.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-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 <lua.h>
-#include <lualib.h>
-#include <lauxlib.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-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 <lua.h>
-#include <lualib.h>
-#include <lauxlib.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-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 <lua.h>
-#include <lualib.h>
-#include <lauxlib.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-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 <lua.h>
-#include <lualib.h>
-#include <lauxlib.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-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 <lua.h>
-#include <lualib.h>
-#include <lauxlib.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-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 <lua.h>
-#include <lualib.h>
-#include <lauxlib.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-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 <lua.h>
-#include <lualib.h>
-#include <lauxlib.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-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 <lua.h>
-#include <lualib.h>
-#include <lauxlib.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-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 <lua.h>
-#include <lualib.h>
-#include <lauxlib.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-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 <lua.h>
-#include <lualib.h>
-#include <lauxlib.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-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