Bug 2928775: Error loading external Lua module with require(); added test for ./ prefix on wildcard matches

This commit is contained in:
starkos 2010-01-13 23:29:21 +00:00
parent a52cc9a668
commit deb345176a
4 changed files with 26 additions and 8 deletions

View File

@ -1,3 +1,10 @@
-----
4.3 (in progress)
-----
* Bug 2928775: Error loading external Lua module with require()
-----
4.2
-----

View File

@ -54,6 +54,9 @@
configuration "macosx"
defines { "LUA_USE_MACOSX" }
configuration "not windows"
linkoptions { "-rdynamic" }
--

View File

@ -1,7 +1,7 @@
--
-- tests/test_os.lua
-- tests/base/test_os.lua
-- Automated test suite for the new OS functions.
-- Copyright (c) 2008, 2009 Jason Perkins and the Premake project
-- Copyright (c) 2008-2010 Jason Perkins and the Premake project
--
@ -28,7 +28,7 @@
--
function suite.isfile_ReturnsTrue_OnExistingFile()
test.istrue(os.isfile("test_os.lua"))
test.istrue(os.isfile("premake4.lua"))
end
function suite.isfile_ReturnsFalse_OnNonexistantFile()
@ -62,6 +62,14 @@
test.istrue(table.contains(result, "actions/xcode/test_xcode_project.lua"))
test.isfalse(table.contains(result, "premake4.lua"))
end
function suite.matchfiles_OnDotSlashPrefix()
test.print("===============================")
local result = os.matchfiles("./**.lua")
test.istrue(table.contains(result, "folder/ok.lua"))
test.print("===============================")
end
--
@ -73,15 +81,15 @@
end
function suite.pathsearch_ReturnsPath_OnFound()
test.isequal(os.getcwd(), os.pathsearch("test_os.lua", os.getcwd()))
test.isequal(os.getcwd(), os.pathsearch("premake4.lua", os.getcwd()))
end
function suite.pathsearch_FindsFile_OnComplexPath()
test.isequal(os.getcwd(), os.pathsearch("test_os.lua", "aaa;"..os.getcwd()..";bbb"))
test.isequal(os.getcwd(), os.pathsearch("premake4.lua", "aaa;"..os.getcwd()..";bbb"))
end
function suite.pathsearch_NilPathsAllowed()
test.isequal(os.getcwd(), os.pathsearch("test_os.lua", nil, os.getcwd(), nil))
test.isequal(os.getcwd(), os.pathsearch("premake4.lua", nil, os.getcwd(), nil))
end

View File

@ -1,7 +1,7 @@
--
-- tests/premake4.lua
-- Automated test suite for Premake 4.x
-- Copyright (c) 2008-2009 Jason Perkins and the Premake project
-- Copyright (c) 2008-2010 Jason Perkins and the Premake project
--
dofile("testfx.lua")
@ -38,7 +38,6 @@
--
dofile("test_dofile.lua")
dofile("test_os.lua")
dofile("test_string.lua")
dofile("test_table.lua")
dofile("test_premake.lua")
@ -57,6 +56,7 @@
dofile("test_gmake_cpp.lua")
dofile("test_gmake_cs.lua")
dofile("base/test_action.lua")
dofile("base/test_os.lua")
dofile("base/test_path.lua")
dofile("base/test_tree.lua")
dofile("actions/test_clean.lua")