public void testKeywordSplitInBuffer() throws Exception {
initRepo();
final byte[] in1 = "1\n$Id:whatever".getBytes();
final byte[] in2 = " continues here$\n3\n".getBytes();
ByteArrayChannel out = new ByteArrayChannel();
final Filter kwFilter = createFilter(Filter.Direction.ToRepo);
out.write(kwFilter.filter(ByteBuffer.wrap(in1)));
out.write(kwFilter.filter(ByteBuffer.wrap(in2)));
Assert.assertEquals("1\n$Id$\n3\n", new String(out.toArray()));
// Same as above, to extreme - only $ in the first buffer
final Filter kwFilter2 = createFilter(Filter.Direction.ToRepo);
out = new ByteArrayChannel();
out.write(kwFilter2.filter(ByteBuffer.wrap("1\n$".getBytes())));
out.write(kwFilter2.filter(ByteBuffer.wrap("Id:whatever continues here$\n3\n".getBytes())));
Assert.assertEquals("1\n$Id$\n3\n", new String(out.toArray()));
}