Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest/IntrospectiveTests
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-09-27 14:52:44 +0200
committerMartin Hořeňovský2021-09-27 14:55:28 +0200
commitd42e7a23a0ca942e73b7065a1fbf28b6b2a817ce (patch)
treedd25a53f6dbd98a36b2aaf1b1f3b4fa31e55df1c /tests/SelfTest/IntrospectiveTests
parent7bb00a42be5195f30b10b944c275c746e446810c (diff)
downloadcatch3-d42e7a23a0ca942e73b7065a1fbf28b6b2a817ce.tar.gz
Change startsWith(char) to take StringRef as argument
Diffstat (limited to 'tests/SelfTest/IntrospectiveTests')
-rw-r--r--tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp b/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp
index d78567ca..ad274939 100644
--- a/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp
+++ b/tests/SelfTest/IntrospectiveTests/StringManip.tests.cpp
@@ -65,3 +65,11 @@ TEST_CASE("splitString", "[string-manip]") {
CHECK_THAT(splitStringRef("abc", ','), Equals(std::vector<StringRef>{"abc"}));
CHECK_THAT(splitStringRef("abc,def", ','), Equals(std::vector<StringRef>{"abc", "def"}));
}
+
+TEST_CASE("startsWith", "[string-manip]") {
+ using Catch::startsWith;
+
+ CHECK_FALSE(startsWith("", 'c'));
+ CHECK(startsWith(std::string("abc"), 'a'));
+ CHECK(startsWith("def"_catch_sr, 'd'));
+}