This repository has been archived on 2022-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
fuck-premake-old2/tests/base/test_action.lua
2009-07-16 14:29:08 +00:00

45 lines
702 B
Lua

--
-- 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.actions["fake"] = fake
end
function T.action.teardown()
premake.actions["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