ByteVector::replace: test shrinking
authorMathias Panzenböck <grosser.meister.morti@gmx.net>
Sat, 6 Aug 2011 17:43:17 +0000 (19:43 +0200)
committerMathias Panzenböck <grosser.meister.morti@gmx.net>
Sat, 6 Aug 2011 17:43:17 +0000 (19:43 +0200)
tests/test_bytevector.cpp

index 69326dbc94252ab6b1df89171492ef3de45b47b3..2ac78b34c188c7658645394f2a5c4bee4f119f36 100644 (file)
@@ -224,6 +224,16 @@ public:
       a.replace(ByteVector("a"), ByteVector("<a>"));
       CPPUNIT_ASSERT_EQUAL(ByteVector("<a>bcd<a>bf"), a);
     }
+    {
+      ByteVector a("abcdabf");
+      a.replace(ByteVector("ab"), ByteVector("x"));
+      CPPUNIT_ASSERT_EQUAL(ByteVector("xcdxf"), a);
+    }
+    {
+      ByteVector a("abcdabf");
+      a.replace(ByteVector("ab"), ByteVector());
+      CPPUNIT_ASSERT_EQUAL(ByteVector("cdf"), a);
+    }
   }
 
 };