diff options
Diffstat (limited to 'testes')
| -rw-r--r-- | testes/attrib.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/testes/attrib.lua b/testes/attrib.lua index b1a4a199..76a447c8 100644 --- a/testes/attrib.lua +++ b/testes/attrib.lua | |||
| @@ -47,6 +47,29 @@ do | |||
| 47 | package.path = oldpath | 47 | package.path = oldpath |
| 48 | end | 48 | end |
| 49 | 49 | ||
| 50 | |||
| 51 | do print"testing 'require' message" | ||
| 52 | local oldpath = package.path | ||
| 53 | local oldcpath = package.cpath | ||
| 54 | |||
| 55 | package.path = "?.lua;?/?" | ||
| 56 | package.cpath = "?.so;?/init" | ||
| 57 | |||
| 58 | local st, msg = pcall(require, 'XXX') | ||
| 59 | |||
| 60 | local expected = [[module 'XXX' not found: | ||
| 61 | no field package.preload['XXX'] | ||
| 62 | no file 'XXX.lua' | ||
| 63 | no file 'XXX/XXX' | ||
| 64 | no file 'XXX.so' | ||
| 65 | no file 'XXX/init']] | ||
| 66 | |||
| 67 | assert(msg == expected) | ||
| 68 | |||
| 69 | package.path = oldpath | ||
| 70 | package.cpath = oldcpath | ||
| 71 | end | ||
| 72 | |||
| 50 | print('+') | 73 | print('+') |
| 51 | 74 | ||
| 52 | 75 | ||
