tests/utils: Add tests for startsWith

This commit is contained in:
Peter Keresztes Schmidt 2021-03-22 23:36:17 +01:00
parent 13f91b5826
commit bde0bde066
1 changed files with 8 additions and 0 deletions

View File

@ -63,3 +63,11 @@ TEST_CASE("replaceAll") {
REQUIRE(replaceAll("aTOKENa", "TOKEN", "VAL") == "aVALa"); REQUIRE(replaceAll("aTOKENa", "TOKEN", "VAL") == "aVALa");
REQUIRE(replaceAll("aTOKENaTOKEN", "TOKEN", "VAL") == "aVALaVAL"); REQUIRE(replaceAll("aTOKENaTOKEN", "TOKEN", "VAL") == "aVALaVAL");
} }
TEST_CASE("startsWith") {
REQUIRE(startsWith("", "") == true);
REQUIRE(startsWith("test", "test") == true);
REQUIRE(startsWith("test=abc", "test") == true);
REQUIRE(startsWith(" test=abc", "test") == false);
}