File: priv.lua

package info (click to toggle)
luakit 1%3A2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,844 kB
  • sloc: ansic: 12,519; makefile: 140; ruby: 79; sh: 48
file content (25 lines) | stat: -rw-r--r-- 515 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- Utilities for use in tests.
--
-- @module tests.util
-- @copyright 2017 Aidan Holm <aidanholm@gmail.com>

local M = {}

function M.load_test_file(test_file)
    local ok, ret = pcall(dofile, test_file)
    if not ok then
        return nil, ret
    end
    assert(type(ret) == "table")

    for test_name, func in pairs(ret) do
        assert(type(test_name) == "string")
        assert(type(func) == "function" or type(func) == "thread")
    end

    return ret
end

return M

-- vim: et:sw=4:ts=8:sts=4:tw=80