diff options
Diffstat (limited to 'testes/main.lua')
| -rw-r--r-- | testes/main.lua | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/testes/main.lua b/testes/main.lua index 47d84d4c..4c09645a 100644 --- a/testes/main.lua +++ b/testes/main.lua | |||
| @@ -347,10 +347,26 @@ NoRun("syntax error", "lua -e a") | |||
| 347 | NoRun("'-l' needs argument", "lua -l") | 347 | NoRun("'-l' needs argument", "lua -l") |
| 348 | 348 | ||
| 349 | 349 | ||
| 350 | if T then -- auxiliary library? | 350 | if T then -- test library? |
| 351 | print("testing 'not enough memory' to create a state") | 351 | print("testing 'not enough memory' to create a state") |
| 352 | NoRun("not enough memory", "env MEMLIMIT=100 lua") | 352 | NoRun("not enough memory", "env MEMLIMIT=100 lua") |
| 353 | |||
| 354 | -- testing 'warn' | ||
| 355 | warn("@123", "456", "789") | ||
| 356 | assert(_WARN == "@123456789") | ||
| 353 | end | 357 | end |
| 358 | |||
| 359 | do | ||
| 360 | -- 'warn' must get at least one argument | ||
| 361 | local st, msg = pcall(warn) | ||
| 362 | assert(string.find(msg, "string expected")) | ||
| 363 | |||
| 364 | -- 'warn' does not leave unfinished warning in case of errors | ||
| 365 | -- (message would appear in next warning) | ||
| 366 | st, msg = pcall(warn, "SHOULD NOT APPEAR", {}) | ||
| 367 | assert(string.find(msg, "string expected")) | ||
| 368 | end | ||
| 369 | |||
| 354 | print('+') | 370 | print('+') |
| 355 | 371 | ||
| 356 | print('testing Ctrl C') | 372 | print('testing Ctrl C') |
