aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-08-16 13:57:19 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-08-16 13:57:19 -0300
commit65434b4d1b5509e95940939e28fd90d4558da12e (patch)
treecb4f78a69bd64f8fbbf1108add57e447a85b0ee5 /testes
parent59acd79c05b78950fe03279d60b015aeed5348ab (diff)
downloadlua-65434b4d1b5509e95940939e28fd90d4558da12e.tar.gz
lua-65434b4d1b5509e95940939e28fd90d4558da12e.tar.bz2
lua-65434b4d1b5509e95940939e28fd90d4558da12e.zip
Option '-l' can give a name for the global variable.
Sintax for this option now is '-l [globname=]modname'.
Diffstat (limited to 'testes')
-rw-r--r--testes/main.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/testes/main.lua b/testes/main.lua
index 56959abd..52c77954 100644
--- a/testes/main.lua
+++ b/testes/main.lua
@@ -190,6 +190,11 @@ prepfile(("print(a); print(_G['%s'].x)"):format(prog), otherprog)
190RUN('env LUA_PATH="?;;" lua -l %s -l%s -lstring -l io %s > %s', prog, otherprog, otherprog, out) 190RUN('env LUA_PATH="?;;" lua -l %s -l%s -lstring -l io %s > %s', prog, otherprog, otherprog, out)
191checkout("1\n2\n15\n2\n15\n") 191checkout("1\n2\n15\n2\n15\n")
192 192
193-- test explicit global names in -l
194prepfile("print(str.upper'alo alo', m.max(10, 20))")
195RUN("lua -l 'str=string' '-lm=math' -e 'print(m.sin(0))' %s > %s", prog, out)
196checkout("0.0\nALO ALO\t20\n")
197
193-- test 'arg' table 198-- test 'arg' table
194local a = [[ 199local a = [[
195 assert(#arg == 3 and arg[1] == 'a' and 200 assert(#arg == 3 and arg[1] == 'a' and