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
diff options
context:
space:
mode:
authorstarkos <unknown>2008-11-13 03:54:41 +0300
committerstarkos <unknown>2008-11-13 03:54:41 +0300
commit20c651957143269c89b98c1439de5ba515abf192 (patch)
tree0de78294ad13a7a580075d8e88b1538555e52771 /tests/test_string.lua
parent608551f8f4bb15630a54bf21f1c48857feb89cb9 (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