Add test for past-the-end substr on StringRef

This commit is contained in:
Martin Hořeňovský 2019-09-08 21:04:23 +02:00
parent 9f4c4777a5
commit dab0296b64
No known key found for this signature in database
GPG key ID: DE48307B8B0D381A
6 changed files with 38 additions and 5 deletions

View file

@ -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" ) {