aboutsummaryrefslogtreecommitdiff
path: root/testes/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'testes/main.lua')
-rw-r--r--testes/main.lua13
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[[
901, a 901, a
91) 91)
92]] 92]]
93RUN('lua - < %s > %s', prog, out) 93RUN('lua - -- < %s > %s', prog, out)
94checkout("1\tnil\n") 94checkout("1\tnil\n")
95 95
96RUN('echo "print(10)\nprint(2)\n" | lua > %s', out) 96RUN('echo "print(10)\nprint(2)\n" | lua > %s', out)
@@ -133,7 +133,7 @@ checkout("-h\n")
133prepfile("print(package.path)") 133prepfile("print(package.path)")
134 134
135-- test LUA_PATH 135-- test LUA_PATH
136RUN('env LUA_INIT= LUA_PATH=x lua %s > %s', prog, out) 136RUN('env LUA_INIT= LUA_PATH=x lua -- %s > %s', prog, out)
137checkout("x\n") 137checkout("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)
226checkout("0.0\nALO ALO\t20\n") 226checkout("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")
230RUN("env LUA_CPATH='./libs/?.so' lua -l lib2-v2 -e 'print(lib2.id())' > %s", 230RUN("env LUA_CPATH='./libs/?.so' lua -l lib2-v2 -e 'print(lib2.id())' > %s",
231 out) 231 out)
232checkout("true\n") 232checkout("true\n")
@@ -347,7 +347,7 @@ checkout("a\n")
347RUN([[lua "-eprint(1)" -ea=3 -e "print(a)" > %s]], out) 347RUN([[lua "-eprint(1)" -ea=3 -e "print(a)" > %s]], out)
348checkout("1\n3\n") 348checkout("1\n3\n")
349 349
350-- test iteractive mode 350-- test interactive mode
351prepfile[[ 351prepfile[[
352(6*2-6) -- === 352(6*2-6) -- ===
353a = 353a =
@@ -358,7 +358,7 @@ RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
358checkprogout("6\n10\n10\n\n") 358checkprogout("6\n10\n10\n\n")
359 359
360prepfile("a = [[b\nc\nd\ne]]\na") 360prepfile("a = [[b\nc\nd\ne]]\na")
361RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out) 361RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i -- < %s > %s]], prog, out)
362checkprogout("b\nc\nd\ne\n\n") 362checkprogout("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
489NoRun("unrecognized option '-h'", "lua -h") 489NoRun("unrecognized option '-h'", "lua -h")
490NoRun("unrecognized option '---'", "lua ---") 490NoRun("unrecognized option '---'", "lua ---")
491NoRun("unrecognized option '-Ex'", "lua -Ex") 491NoRun("unrecognized option '-Ex'", "lua -Ex --")
492NoRun("unrecognized option '-vv'", "lua -vv") 492NoRun("unrecognized option '-vv'", "lua -vv")
493NoRun("unrecognized option '-iv'", "lua -iv") 493NoRun("unrecognized option '-iv'", "lua -iv")
494NoRun("'-e' needs argument", "lua -e") 494NoRun("'-e' needs argument", "lua -e")
495NoRun("syntax error", "lua -e a") 495NoRun("syntax error", "lua -e a")
496NoRun("'-l' needs argument", "lua -l") 496NoRun("'-l' needs argument", "lua -l")
497NoRun("-i", "lua -- -i") -- handles -i as a script name
497 498
498 499
499if T then -- test library? 500if T then -- test library?