diff options
author | starkos <none@none> | 2009-08-12 19:22:44 +0400 |
---|---|---|
committer | starkos <none@none> | 2009-08-12 19:22:44 +0400 |
commit | d8342e495bcc4af120af3bda105e578547a92acc (patch) | |
tree | d7c6b6ba9f2d4770ef1bcafcf753759d05ded08f /tests | |
parent | b1ee77fef3a6b720ee5f27deb321f44fcd04a0bc (diff) |
Shortened name placeholder for project.getfilename
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_premake.lua | 4 | ||||
-rw-r--r-- | tests/test_project.lua | 2 | ||||
-rw-r--r-- | tests/testfx.lua | 8 |
3 files changed, 11 insertions, 3 deletions
diff --git a/tests/test_premake.lua b/tests/test_premake.lua index c0b6964..552f955 100644 --- a/tests/test_premake.lua +++ b/tests/test_premake.lua @@ -36,12 +36,12 @@ function T.premake.generate_OpensCorrectFile() prj = { name = "MyProject", location = "MyLocation" } - premake.generate(prj, "{name}.prj", function () end) + premake.generate(prj, "%%.prj", function () end) test.openedfile("MyLocation/MyProject.prj") end function T.premake.generate_ClosesFile() prj = { name = "MyProject", location = "MyLocation" } - premake.generate(prj, "{path}/{name}.prj", function () end) + premake.generate(prj, "%%.prj", function () end) test.closedfile(true) end diff --git a/tests/test_project.lua b/tests/test_project.lua index feb4b33..fab64bb 100644 --- a/tests/test_project.lua +++ b/tests/test_project.lua @@ -34,7 +34,7 @@ function T.project.getfilename_PerformsSubstitutions() local prj = { name = "project", location = "location" } - local r = _project.getfilename(prj, "{name}.prj") + local r = _project.getfilename(prj, "%%.prj") test.isequal("location/project.prj", r) end diff --git a/tests/testfx.lua b/tests/testfx.lua index a1e7eb6..9c50a9c 100644 --- a/tests/testfx.lua +++ b/tests/testfx.lua @@ -148,6 +148,8 @@ local function stub_io_output(f) end + local function stub_print(s) + end -- @@ -169,6 +171,10 @@ _OPTIONS = { } _SOLUTIONS = { } + -- capture any printed output + test.print = print + print = stub_print + test.value_openedfilename = nil test.value_openedfilemode = nil test.value_closedfile = false @@ -187,6 +193,8 @@ local function test_teardown(suite, fn) + print = test.print + if suite.teardown then return pcall(suite.teardown) else |