aboutsummaryrefslogtreecommitdiff
path: root/tests/test.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test.lua')
-rwxr-xr-xtests/test.lua15
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
45package.path = "../?.lua;../?/init.lua;"..package.path 45package.path = "../?.lua;../?/init.lua;"..package.path
46package.cpath = "./?-"..V..".so;./?-"..V..".dll;./?.so;./?.dll" 46package.cpath = "./?-"..V..".so;./?-"..V..".dll;./?.so;./?.dll"
47if mode == "module" then 47if 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
51else 51else
52 print( "testing Lua API using `compat53` ..." ) 52 print("testing Lua API using `compat53` ...")
53 require("compat53") 53 require("compat53")
54end 54end
55 55
56
57___''
58do
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)))
64end
65
66
56___'' 67___''
57do 68do
58 local t = setmetatable({}, { __index = { 1, false, "three" } }) 69 local t = setmetatable({}, { __index = { 1, false, "three" } })