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

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstarkos <none@none>2008-11-13 03:54:41 +0300
committerstarkos <none@none>2008-11-13 03:54:41 +0300
commit4539b1e1b3336b52b77b11696f9664e5ebb0d1e4 (patch)
tree0de78294ad13a7a580075d8e88b1538555e52771 /tests/test_string.lua
parentc257e9c746f096ca4294168a8a2c26de538eb36c (diff)
** Merged branches/vstudio (r539:562) Added Visual Studio support
Diffstat (limited to 'tests/test_string.lua')
-rw-r--r--tests/test_string.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_string.lua b/tests/test_string.lua
index 3ce1f1f..1d8081d 100644
--- a/tests/test_string.lua
+++ b/tests/test_string.lua
@@ -41,3 +41,29 @@
function T.string.explode_ReturnsParts_OnValidCall()
test.isequal({"aaa","bbb","ccc"}, string.explode("aaa/bbb/ccc", "/", true))
end
+
+
+
+--
+-- string.startswith() tests
+--
+
+ function T.string.startswith_OnMatch()
+ test.istrue(string.startswith("Abcdef", "Abc"))
+ end
+
+ function T.string.startswith_OnMismatch()
+ test.isfalse(string.startswith("Abcdef", "ghi"))
+ end
+
+ function T.string.startswith_OnLongerNeedle()
+ test.isfalse(string.startswith("Abc", "Abcdef"))
+ end
+
+ function T.string.startswith_OnEmptyHaystack()
+ test.isfalse(string.startswith("", "Abc"))
+ end
+
+ function T.string.startswith_OnEmptyNeedle()
+ test.istrue(string.startswith("Abcdef", ""))
+ end