aboutsummaryrefslogtreecommitdiff
path: root/testes/main.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-05-15 13:46:38 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-05-15 13:46:38 -0300
commit09f3c2372f5dbeaec9f50614a26c1b5761726a88 (patch)
tree83469dd02dba1c59ead0eb0cba3a35bd39ec899d /testes/main.lua
parentc197885cb00b85251c35cffdc4057efaee2d7a88 (diff)
downloadlua-09f3c2372f5dbeaec9f50614a26c1b5761726a88.tar.gz
lua-09f3c2372f5dbeaec9f50614a26c1b5761726a88.tar.bz2
lua-09f3c2372f5dbeaec9f50614a26c1b5761726a88.zip
Option '-l' discards version sufix from file name
Like 'require', the command-line option '-l' discards an optional version suffix (everything after an hyphen) from a file name when creating the module name.
Diffstat (limited to 'testes/main.lua')
-rw-r--r--testes/main.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/testes/main.lua b/testes/main.lua
index 3fa94e97..11b14b44 100644
--- a/testes/main.lua
+++ b/testes/main.lua
@@ -225,6 +225,13 @@ prepfile("print(str.upper'alo alo', m.max(10, 20))")
225RUN("lua -l 'str=string' '-lm=math' -e 'print(m.sin(0))' %s > %s", prog, out) 225RUN("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
229-- test module names with version sufix ("libs/lib2-v2")
230RUN("env LUA_CPATH='./libs/?.so' lua -l lib2-v2 -e 'print(lib2.id())' > %s",
231 out)
232checkout("true\n")
233
234
228-- test 'arg' table 235-- test 'arg' table
229local a = [[ 236local a = [[
230 assert(#arg == 3 and arg[1] == 'a' and 237 assert(#arg == 3 and arg[1] == 'a' and