mirror of
https://github.com/WinampDesktop/winamp.git
synced 2024-12-13 18:41:00 -05:00
37 lines
646 B
Lua
37 lines
646 B
Lua
|
--
|
||
|
-- tests/test_dofile.lua
|
||
|
-- Automated test suite for the extended dofile() functions.
|
||
|
-- Copyright (c) 2008 Jason Perkins and the Premake project
|
||
|
--
|
||
|
|
||
|
|
||
|
T.dofile = { }
|
||
|
|
||
|
|
||
|
local os_getenv
|
||
|
|
||
|
function T.dofile.setup()
|
||
|
os_getenv = os.getenv
|
||
|
end
|
||
|
|
||
|
function T.dofile.teardown()
|
||
|
os.getenv = os_getenv
|
||
|
end
|
||
|
|
||
|
|
||
|
--
|
||
|
-- dofile() tests
|
||
|
--
|
||
|
|
||
|
function T.dofile.SearchesPath()
|
||
|
os.getenv = function() return os.getcwd().."/folder" end
|
||
|
result = dofile("ok.lua")
|
||
|
test.isequal("ok", result)
|
||
|
end
|
||
|
|
||
|
function T.dofile.SearchesScriptsOption()
|
||
|
_OPTIONS["scripts"] = os.getcwd().."/folder"
|
||
|
result = dofile("ok.lua")
|
||
|
test.isequal("ok", result)
|
||
|
end
|