diff options
Diffstat (limited to 'testes/main.lua')
-rw-r--r-- | testes/main.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/testes/main.lua b/testes/main.lua index bf3c898e..dc48dc48 100644 --- a/testes/main.lua +++ b/testes/main.lua | |||
@@ -90,7 +90,7 @@ prepfile[[ | |||
90 | 1, a | 90 | 1, a |
91 | ) | 91 | ) |
92 | ]] | 92 | ]] |
93 | RUN('lua - < %s > %s', prog, out) | 93 | RUN('lua - -- < %s > %s', prog, out) |
94 | checkout("1\tnil\n") | 94 | checkout("1\tnil\n") |
95 | 95 | ||
96 | RUN('echo "print(10)\nprint(2)\n" | lua > %s', out) | 96 | RUN('echo "print(10)\nprint(2)\n" | lua > %s', out) |
@@ -133,7 +133,7 @@ checkout("-h\n") | |||
133 | prepfile("print(package.path)") | 133 | prepfile("print(package.path)") |
134 | 134 | ||
135 | -- test LUA_PATH | 135 | -- test LUA_PATH |
136 | RUN('env LUA_INIT= LUA_PATH=x lua %s > %s', prog, out) | 136 | RUN('env LUA_INIT= LUA_PATH=x lua -- %s > %s', prog, out) |
137 | checkout("x\n") | 137 | checkout("x\n") |
138 | 138 | ||
139 | -- test LUA_PATH_version | 139 | -- test LUA_PATH_version |
@@ -226,7 +226,7 @@ RUN("lua -l 'str=string' '-lm=math' -e 'print(m.sin(0))' %s > %s", prog, out) | |||
226 | checkout("0.0\nALO ALO\t20\n") | 226 | checkout("0.0\nALO ALO\t20\n") |
227 | 227 | ||
228 | 228 | ||
229 | -- test module names with version sufix ("libs/lib2-v2") | 229 | -- test module names with version suffix ("libs/lib2-v2") |
230 | RUN("env LUA_CPATH='./libs/?.so' lua -l lib2-v2 -e 'print(lib2.id())' > %s", | 230 | RUN("env LUA_CPATH='./libs/?.so' lua -l lib2-v2 -e 'print(lib2.id())' > %s", |
231 | out) | 231 | out) |
232 | checkout("true\n") | 232 | checkout("true\n") |
@@ -347,7 +347,7 @@ checkout("a\n") | |||
347 | RUN([[lua "-eprint(1)" -ea=3 -e "print(a)" > %s]], out) | 347 | RUN([[lua "-eprint(1)" -ea=3 -e "print(a)" > %s]], out) |
348 | checkout("1\n3\n") | 348 | checkout("1\n3\n") |
349 | 349 | ||
350 | -- test iteractive mode | 350 | -- test interactive mode |
351 | prepfile[[ | 351 | prepfile[[ |
352 | (6*2-6) -- === | 352 | (6*2-6) -- === |
353 | a = | 353 | a = |
@@ -358,7 +358,7 @@ RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out) | |||
358 | checkprogout("6\n10\n10\n\n") | 358 | checkprogout("6\n10\n10\n\n") |
359 | 359 | ||
360 | prepfile("a = [[b\nc\nd\ne]]\na") | 360 | prepfile("a = [[b\nc\nd\ne]]\na") |
361 | RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out) | 361 | RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i -- < %s > %s]], prog, out) |
362 | checkprogout("b\nc\nd\ne\n\n") | 362 | checkprogout("b\nc\nd\ne\n\n") |
363 | 363 | ||
364 | -- input interrupted in continuation line | 364 | -- input interrupted in continuation line |
@@ -488,12 +488,13 @@ assert(not os.remove(out)) | |||
488 | -- invalid options | 488 | -- invalid options |
489 | NoRun("unrecognized option '-h'", "lua -h") | 489 | NoRun("unrecognized option '-h'", "lua -h") |
490 | NoRun("unrecognized option '---'", "lua ---") | 490 | NoRun("unrecognized option '---'", "lua ---") |
491 | NoRun("unrecognized option '-Ex'", "lua -Ex") | 491 | NoRun("unrecognized option '-Ex'", "lua -Ex --") |
492 | NoRun("unrecognized option '-vv'", "lua -vv") | 492 | NoRun("unrecognized option '-vv'", "lua -vv") |
493 | NoRun("unrecognized option '-iv'", "lua -iv") | 493 | NoRun("unrecognized option '-iv'", "lua -iv") |
494 | NoRun("'-e' needs argument", "lua -e") | 494 | NoRun("'-e' needs argument", "lua -e") |
495 | NoRun("syntax error", "lua -e a") | 495 | NoRun("syntax error", "lua -e a") |
496 | NoRun("'-l' needs argument", "lua -l") | 496 | NoRun("'-l' needs argument", "lua -l") |
497 | NoRun("-i", "lua -- -i") -- handles -i as a script name | ||
497 | 498 | ||
498 | 499 | ||
499 | if T then -- test library? | 500 | if T then -- test library? |