Fix StringRef self-assignment after substring
Thanks to Alex Tkachenko for spotting it.
This commit is contained in:
parent
e680c4b9fb
commit
3bce8ba14b
2 changed files with 11 additions and 4 deletions
|
@ -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") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue