From 65434b4d1b5509e95940939e28fd90d4558da12e Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 16 Aug 2021 13:57:19 -0300 Subject: Option '-l' can give a name for the global variable. Sintax for this option now is '-l [globname=]modname'. --- testes/main.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'testes') 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) RUN('env LUA_PATH="?;;" lua -l %s -l%s -lstring -l io %s > %s', prog, otherprog, otherprog, out) checkout("1\n2\n15\n2\n15\n") +-- test explicit global names in -l +prepfile("print(str.upper'alo alo', m.max(10, 20))") +RUN("lua -l 'str=string' '-lm=math' -e 'print(m.sin(0))' %s > %s", prog, out) +checkout("0.0\nALO ALO\t20\n") + -- test 'arg' table local a = [[ assert(#arg == 3 and arg[1] == 'a' and -- cgit v1.2.3-55-g6feb