-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.lua
45 lines (27 loc) · 1.25 KB
/
test.lua
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
local checkpoint = dofile(shell.dir().."/checkpoint.lua")
local testAPI = dofile(shell.dir().."/testAPI.lua")
local test = testAPI.test
local howlciLog = testAPI.howlci.log
-- tests:
-- terminate part way through file, restart the file and it continues
-- call a non existing checkpoint
-- run all function in the api
-- have a callback error
-- error tracing on and off
-- custom file
-- function tests
-- expected args
local function warnFailCausedSkips()
howlciLog("warn", "some tests were skipped due to a dependent function failing it's test")
end
local function dummyCallback()
end
local addPassed= test("function tests: expected args: checkpoint.add", true, nil, checkpoint.add, "testLabel", dummyCallback)
if addPassed then
local reachPassed = test("function tests: expected args: checkpoint.reach", true, nil, checkpoint.reach, "testLabel", dummyCallback)
local removePassed = test("function tests: expected args: checkpoint.remove", true, nil, checkpoint.remove, "testLabel", dummyCallback)
checkpoint.add("testLabel", dummyCallback)
local runPassed = test("function tests: expected args: checkpoint.run", true, nil, checkpoint.run, "testLabel")
else
warnFailCausedSkips()
end