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

summaryrefslogtreecommitdiffhomepage
path: root/projects/SelfTest/IntrospectiveTests/String.tests.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2019-09-08 21:04:23 +0200
committerMartin Hořeňovský2019-09-08 21:07:21 +0200
commitdab0296b64483034d7b802a0635fae840ba31727 (patch)
tree51b49f968df66c9a829d549ae193c7c806d7965f /projects/SelfTest/IntrospectiveTests/String.tests.cpp
parent9f4c4777a5136a3e1f276398799961e9ccb4b572 (diff)
downloadcatch3-dab0296b64483034d7b802a0635fae840ba31727.tar.gz
Add test for past-the-end substr on StringRef
Diffstat (limited to 'projects/SelfTest/IntrospectiveTests/String.tests.cpp')
-rw-r--r--projects/SelfTest/IntrospectiveTests/String.tests.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/projects/SelfTest/IntrospectiveTests/String.tests.cpp b/projects/SelfTest/IntrospectiveTests/String.tests.cpp
index 77c16dcb..456dd4a7 100644
--- a/projects/SelfTest/IntrospectiveTests/String.tests.cpp
+++ b/projects/SelfTest/IntrospectiveTests/String.tests.cpp
@@ -111,6 +111,10 @@ TEST_CASE( "StringRef", "[Strings][StringRef]" ) {
SECTION( "Pointer values of substring refs should not match" ) {
REQUIRE( s.c_str() != ss.c_str() );
}
+
+ SECTION("Past the end substring") {
+ REQUIRE(s.substr(s.size() + 1, 123).empty());
+ }
}
SECTION( "Comparisons" ) {