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:
authorPhil Nash2019-05-18 17:54:06 +0100
committerPhil Nash2019-05-18 17:54:39 +0100
commit3bce8ba14b5dfb55c0127b8ad9eddf5a92b662c0 (patch)
treef0949870cd72cabed593a2bd033dd1182b95fc4a /projects/SelfTest/IntrospectiveTests/String.tests.cpp
parente680c4b9fb1d699bfad239e42ce7643d7cf00371 (diff)
downloadcatch3-3bce8ba14b5dfb55c0127b8ad9eddf5a92b662c0.tar.gz
Fix StringRef self-assignment after substring
Thanks to Alex Tkachenko for spotting it.
Diffstat (limited to 'projects/SelfTest/IntrospectiveTests/String.tests.cpp')
-rw-r--r--projects/SelfTest/IntrospectiveTests/String.tests.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/projects/SelfTest/IntrospectiveTests/String.tests.cpp b/projects/SelfTest/IntrospectiveTests/String.tests.cpp
index cb2c350c..1a3bf6d2 100644
--- a/projects/SelfTest/IntrospectiveTests/String.tests.cpp
+++ b/projects/SelfTest/IntrospectiveTests/String.tests.cpp
@@ -92,6 +92,11 @@ TEST_CASE( "StringRef", "[Strings][StringRef]" ) {
REQUIRE( isOwned( ss ) );
REQUIRE( ss.currentData() != s.currentData() ); // different pointer value
+
+ SECTION( "Self-assignment after substring" ) {
+ ss = ss;
+ REQUIRE(isOwned(ss) == true);
+ }
}
SECTION( "non-zero-based substring") {