Skip to content

Commit d63e640

Browse files
committed
tests/lapi: fix os_time_test
In some cases `os.time()` returns `nil` and this breaks the test. The patch fixes that. Follows up #141
1 parent de2f1ab commit d63e640

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/lapi/os_time_test.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ local function TestOneInput(buf)
3232
local err_handler = test_lib.err_handler(ignored_msgs)
3333
local ok, res = xpcall(os.time, err_handler, time)
3434
if not ok then return end
35-
assert(type(res) == "number" or type(res) == "table")
35+
io.stderr:write(type(res) .. "\n")
36+
assert(type(res) == "number" or
37+
type(res) == "table" or
38+
-- Undocumented.
39+
res == nil)
3640
end
3741

3842
local args = {

0 commit comments

Comments
 (0)