Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJason Perkins <starkos@industriousone.com>2012-01-20 00:28:24 +0400
committerJason Perkins <starkos@industriousone.com>2012-01-20 00:28:24 +0400
commite4d23a49bf9c3c917c006385d6c536ff763e19f8 (patch)
treea379d7a9b20140f5e689349651a1f5b22fb7e63d /tests
parentb1df4ff7ae8dafbc9ec332b9971c93559a4a4e11 (diff)
Patch 3111264: Allow path.join() to accept any number of args
Diffstat (limited to 'tests')
-rw-r--r--tests/actions/test_clean.lua1
-rw-r--r--tests/base/test_path.lua30
2 files changed, 25 insertions, 6 deletions
diff --git a/tests/actions/test_clean.lua b/tests/actions/test_clean.lua
index bcea777..f0badbc 100644
--- a/tests/actions/test_clean.lua
+++ b/tests/actions/test_clean.lua
@@ -106,7 +106,6 @@
language "C++"
kind "ConsoleApp"
prepare()
- test.contains(removed, "obj")
test.contains(removed, "obj/Debug")
test.contains(removed, "obj/Release")
end
diff --git a/tests/base/test_path.lua b/tests/base/test_path.lua
index c2b153f..2332dce 100644
--- a/tests/base/test_path.lua
+++ b/tests/base/test_path.lua
@@ -182,23 +182,43 @@
--
function suite.join_OnValidParts()
- test.isequal("leading/trailing", path.join("leading", "trailing"))
+ test.isequal("p1/p2", path.join("p1", "p2"))
end
function suite.join_OnAbsoluteUnixPath()
- test.isequal("/trailing", path.join("leading", "/trailing"))
+ test.isequal("/p2", path.join("p1", "/p2"))
end
function suite.join_OnAbsoluteWindowsPath()
- test.isequal("C:/trailing", path.join("leading", "C:/trailing"))
+ test.isequal("C:/p2", path.join("p1", "C:/p2"))
end
function suite.join_OnCurrentDirectory()
- test.isequal("trailing", path.join(".", "trailing"))
+ test.isequal("p2", path.join(".", "p2"))
end
function suite.join_OnNilSecondPart()
- test.isequal("leading", path.join("leading", nil))
+ test.isequal("p1", path.join("p1", nil))
+ end
+
+ function suite.join_onMoreThanTwoParts()
+ test.isequal("p1/p2/p3", path.join("p1", "p2", "p3"))
+ end
+
+ function suite.join_removesExtraInternalSlashes()
+ test.isequal("p1/p2", path.join("p1/", "p2"))
+ end
+
+ function suite.join_removesTrailingSlash()
+ test.isequal("p1/p2", path.join("p1", "p2/"))
+ end
+
+ function suite.join_ignoresNilParts()
+ test.isequal("p2", path.join(nil, "p2", nil))
+ end
+
+ function suite.join_ignoresEmptyParts()
+ test.isequal("p2", path.join("", "p2", ""))
end