blob: 882e2421251d66ad174b7e5bb89d2d75eddac17b (
plain)
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
|
--
-- tests/base/test_action.lua
-- Automated test suite for the action list.
-- Copyright (c) 2009 Jason Perkins and the Premake project
--
T.action = { }
--
-- Setup/teardown
--
local fake = {
trigger = "fake",
description = "Fake action used for testing",
}
function T.action.setup()
premake.action.list["fake"] = fake
end
function T.action.teardown()
premake.action.list["fake"] = nil
end
--
-- Tests
--
function T.action.ExecuteIsCalledIfPresent()
local called = false
fake.execute = function () called = true end
premake.action.call("fake")
test.istrue(called)
end
function T.action.ExecuteIsSkippedIfNotPresent()
test.success(premake.action.call, "fake")
end
|