[ox/std] Add BasicString::beginsWith

This commit is contained in:
2022-03-23 03:08:04 -05:00
parent ccfc7d5405
commit 9161a1a8ef
2 changed files with 23 additions and 0 deletions

View File

@@ -78,6 +78,11 @@ std::map<std::string, std::function<ox::Error()>> tests = {
s += "aoeu";
oxAssert(s == "asdfaoeu", "String append broken");
ox::String ending = "asdf";
oxAssert(ending.beginsWith("as"), "String::beginsWith is broken");
oxAssert(!ending.beginsWith("aa"), "String::beginsWith is broken");
oxAssert(!ending.beginsWith("aaaaaaa"), "String::beginsWith is broken");
oxAssert(!ending.beginsWith("li"), "String::beginsWith is broken");
oxAssert(!ending.beginsWith("afoif"), "String::beginsWith is broken");
oxAssert(ending.endsWith("df"), "String::endsWith is broken");
oxAssert(!ending.endsWith("awefawe"), "String::endsWith is broken");
oxAssert(!ending.endsWith("eu"), "String::endsWith is broken");