diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-05-15 13:46:38 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-05-15 13:46:38 -0300 |
commit | 09f3c2372f5dbeaec9f50614a26c1b5761726a88 (patch) | |
tree | 83469dd02dba1c59ead0eb0cba3a35bd39ec899d /testes/main.lua | |
parent | c197885cb00b85251c35cffdc4057efaee2d7a88 (diff) | |
download | lua-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.lua | 7 |
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))") | |||
225 | RUN("lua -l 'str=string' '-lm=math' -e 'print(m.sin(0))' %s > %s", prog, out) | 225 | 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 | |||
229 | -- test module names with version sufix ("libs/lib2-v2") | ||
230 | RUN("env LUA_CPATH='./libs/?.so' lua -l lib2-v2 -e 'print(lib2.id())' > %s", | ||
231 | out) | ||
232 | checkout("true\n") | ||
233 | |||
234 | |||
228 | -- test 'arg' table | 235 | -- test 'arg' table |
229 | local a = [[ | 236 | local a = [[ |
230 | assert(#arg == 3 and arg[1] == 'a' and | 237 | assert(#arg == 3 and arg[1] == 'a' and |