diff options
| author | Martin Hořeňovský | 2019-09-08 21:04:23 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2019-09-08 21:07:21 +0200 |
| commit | dab0296b64483034d7b802a0635fae840ba31727 (patch) | |
| tree | 51b49f968df66c9a829d549ae193c7c806d7965f /projects/SelfTest/IntrospectiveTests/String.tests.cpp | |
| parent | 9f4c4777a5136a3e1f276398799961e9ccb4b572 (diff) | |
| download | catch3-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.cpp | 4 |
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" ) { |