Index: src/libchcore/Tests/TestsTString.cpp =================================================================== diff -u -N -r9479911a096555a7504c5c8a8eaee83ecb63440c -rbe86ea000c8ee746379fd5018c9f43a9b1cddfa1 --- src/libchcore/Tests/TestsTString.cpp (.../TestsTString.cpp) (revision 9479911a096555a7504c5c8a8eaee83ecb63440c) +++ src/libchcore/Tests/TestsTString.cpp (.../TestsTString.cpp) (revision be86ea000c8ee746379fd5018c9f43a9b1cddfa1) @@ -615,3 +615,13 @@ strValue.TrimRightSelf(L"gn"); EXPECT_EQ(strValue, L"Some stri"); } + +TEST(TStringTests, ReplaceAffectingOtherStringInstancesBug) +{ + TString strValue(_T("Some string")); + TString strSecond(strValue); + + strValue.Replace(_T("Some "), _T("No ")); + + EXPECT_EQ(strSecond, _T("Some string")); +}