1 #include <UnitTest++/UnitTest++.h>
3 #include "StringUtils.h"
7 using namespace WikiWalker
;
9 TEST(TestBeginString_Positives
)
11 CHECK(StringUtils::startsWith("foo", "f"));
12 CHECK(StringUtils::startsWith("Buddy", "Bud"));
13 CHECK(StringUtils::startsWith("camelCase", "cam"));
16 TEST(TestBeginString_Equality
)
18 CHECK(StringUtils::startsWith("foo", "foo"));
19 CHECK(StringUtils::startsWith("Buddy", "Buddy"));
20 CHECK(StringUtils::startsWith("camelCase", "camelCase"));
23 TEST(TestBeginString_SecondStringIsLonger
)
25 CHECK(!StringUtils::startsWith("f", "foo"));
26 CHECK(!StringUtils::startsWith("Bu", "Bud"));
27 CHECK(!StringUtils::startsWith("cam", "camel"));
30 TEST(TestBeginString_EmptyString
)
32 CHECK(!StringUtils::startsWith("foo", ""));
33 CHECK(!StringUtils::startsWith("", "foo"));
34 CHECK(!StringUtils::startsWith("", ""));