diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/test.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/test.lua b/tests/test.lua index 9ac27d4..7e9d57f 100755 --- a/tests/test.lua +++ b/tests/test.lua | |||
| @@ -45,14 +45,25 @@ end | |||
| 45 | package.path = "../?.lua;../?/init.lua;"..package.path | 45 | package.path = "../?.lua;../?/init.lua;"..package.path |
| 46 | package.cpath = "./?-"..V..".so;./?-"..V..".dll;./?.so;./?.dll" | 46 | package.cpath = "./?-"..V..".so;./?-"..V..".dll;./?.so;./?.dll" |
| 47 | if mode == "module" then | 47 | if mode == "module" then |
| 48 | print( "testing Lua API using `compat53.module` ..." ) | 48 | print("testing Lua API using `compat53.module` ...") |
| 49 | _ENV = require("compat53.module") | 49 | _ENV = require("compat53.module") |
| 50 | if setfenv then setfenv(1, _ENV) end | 50 | if setfenv then setfenv(1, _ENV) end |
| 51 | else | 51 | else |
| 52 | print( "testing Lua API using `compat53` ..." ) | 52 | print("testing Lua API using `compat53` ...") |
| 53 | require("compat53") | 53 | require("compat53") |
| 54 | end | 54 | end |
| 55 | 55 | ||
| 56 | |||
| 57 | ___'' | ||
| 58 | do | ||
| 59 | print("assert", F(pcall(assert, false))) | ||
| 60 | print("assert", F(pcall(assert, false, nil))) | ||
| 61 | print("assert", F(pcall(assert, false, "error msg"))) | ||
| 62 | print("assert", F(pcall(assert, nil, {}))) | ||
| 63 | print("assert", F(pcall(assert, 1, 2, 3))) | ||
| 64 | end | ||
| 65 | |||
| 66 | |||
| 56 | ___'' | 67 | ___'' |
| 57 | do | 68 | do |
| 58 | local t = setmetatable({}, { __index = { 1, false, "three" } }) | 69 | local t = setmetatable({}, { __index = { 1, false, "three" } }) |
