diff --git a/tests/bad_span.lua b/tests/bad_span.lua new file mode 100644 index 0000000..2fd0c03 --- /dev/null +++ b/tests/bad_span.lua @@ -0,0 +1,3 @@ +@[{ + fuck +}] \ No newline at end of file diff --git a/tests/escape_hell.lua b/tests/escape_hell.lua new file mode 100644 index 0000000..5181676 --- /dev/null +++ b/tests/escape_hell.lua @@ -0,0 +1 @@ +--#error "fuck\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" \ No newline at end of file diff --git a/tests/lua_test.lua b/tests/lua_test.lua new file mode 100644 index 0000000..fcad6ee --- /dev/null +++ b/tests/lua_test.lua @@ -0,0 +1,3 @@ +@[[for i=1, 10 do]] + print("hello @[{i}]") +@[[end]] \ No newline at end of file diff --git a/tests/noblockclose.lua b/tests/noblockclose.lua new file mode 100644 index 0000000..7ab72fe --- /dev/null +++ b/tests/noblockclose.lua @@ -0,0 +1,2 @@ +@[[ +lmao \ No newline at end of file diff --git a/tests/nonewline_directive.lua b/tests/nonewline_directive.lua new file mode 100644 index 0000000..5c8ab75 --- /dev/null +++ b/tests/nonewline_directive.lua @@ -0,0 +1,2 @@ +-- include file +--#include "nopreproc.lua" \ No newline at end of file diff --git a/tests/nopreproc.lua b/tests/nopreproc.lua new file mode 100644 index 0000000..66632ea --- /dev/null +++ b/tests/nopreproc.lua @@ -0,0 +1 @@ +print("test") \ No newline at end of file diff --git a/tests/runtests.sh b/tests/runtests.sh new file mode 100755 index 0000000..b68193e --- /dev/null +++ b/tests/runtests.sh @@ -0,0 +1,5 @@ +for test in $(find -name "*.lua"); do + echo "Running test $test" + luacomp $test > $test.out + echo "==============================================================" +done \ No newline at end of file diff --git a/tests/shell.lua b/tests/shell.lua new file mode 100644 index 0000000..c4d5ed2 --- /dev/null +++ b/tests/shell.lua @@ -0,0 +1,6 @@ +-- raw evar +print("your shell is $[{SHELL}]") +-- evar string +print("your shell is "..$(SHELL)) +-- cat +$[[cat nopreproc.lua]]