aboutsummaryrefslogtreecommitdiff
path: root/tests/test.lua
diff options
context:
space:
mode:
authorPhilipp Janda <siffiejoe@gmx.net>2015-08-18 00:49:22 +0200
committerPhilipp Janda <siffiejoe@gmx.net>2015-08-18 00:49:22 +0200
commitdb7cb39cdd973deca26ad96d5a478a4ba1d98f30 (patch)
tree3b7716ec06cfea17e476b62ec17e3ff53a0697af /tests/test.lua
parentfb114d8dc6810133ba9e10d75fa9887ee169bf5d (diff)
downloadlua-compat-5.3-db7cb39cdd973deca26ad96d5a478a4ba1d98f30.tar.gz
lua-compat-5.3-db7cb39cdd973deca26ad96d5a478a4ba1d98f30.tar.bz2
lua-compat-5.3-db7cb39cdd973deca26ad96d5a478a4ba1d98f30.zip
assert() can handle non-string errors.
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" } })