Add an overload of ByteVector::replace() which takes chars.

Currently, this is only way of using ByteVector::replace().
This commit is contained in:
Tsuda Kageyu
2016-02-18 03:47:02 +09:00
parent a9acca5d81
commit 07d95e0dc0
5 changed files with 29 additions and 4 deletions

View File

@ -266,6 +266,11 @@ public:
a.replace(ByteVector("a"), ByteVector("x"));
CPPUNIT_ASSERT_EQUAL(ByteVector("xbcdxbf"), a);
}
{
ByteVector a("abcdabf");
a.replace('a', 'x');
CPPUNIT_ASSERT_EQUAL(ByteVector("xbcdxbf"), a);
}
{
ByteVector a("abcdabf");
a.replace(ByteVector("ab"), ByteVector("xy"));