File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 11
11
#include <lauxlib.h>
12
12
#include <lualib.h>
13
13
14
+ //#define TEST_BASIC
15
+ //#define TEST_DIR
16
+ #define TEST_FILE
17
+
14
18
static void test_lua (void )
15
19
{
16
20
lua_State * L ;
17
21
18
- // /patchpool/nil - Cid and Lucy.fnp
19
-
20
22
L = luaL_newstate ();
21
23
luaL_openlibs (L );
24
+ #ifdef TEST_BASIC
22
25
luaL_dostring (L , "for i=10,1,-1 do print(i) end\n" );
26
+ #endif
27
+ #ifdef TEST_DIR
23
28
luaL_dostring (L , "function attrdir (path)\n"
24
29
" for file in lfs.dir(path) do\n"
25
30
" if file ~= \".\" and file ~= \"..\" then\n"
@@ -39,6 +44,13 @@ static void test_lua(void)
39
44
"end\n"
40
45
"\n"
41
46
"attrdir (\"/\")\n" );
47
+ #endif
48
+ #ifdef TEST_FILE
49
+ luaL_dostring (L , "f = assert(io.open(\"/patchpool/nil - Cid and Lucy.fnp\"))\n"
50
+ "t = f:read(\"*all\")\n"
51
+ "print(t)\n"
52
+ "f:close()\n" );
53
+ #endif
42
54
lua_close (L );
43
55
}
44
56
You can’t perform that action at this time.
0 commit comments