diff options
author | Philipp Janda <siffiejoe@gmx.net> | 2015-08-18 00:49:22 +0200 |
---|---|---|
committer | Philipp Janda <siffiejoe@gmx.net> | 2015-08-18 00:49:22 +0200 |
commit | db7cb39cdd973deca26ad96d5a478a4ba1d98f30 (patch) | |
tree | 3b7716ec06cfea17e476b62ec17e3ff53a0697af /tests/test.lua | |
parent | fb114d8dc6810133ba9e10d75fa9887ee169bf5d (diff) | |
download | lua-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-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" } }) |