Skip to content

Commit 226a0d7

Browse files
committed
Try to make the test reporduce the encoding problem
1 parent b4c07fe commit 226a0d7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

logstash-core/src/test/java/org/logstash/common/BufferedTokenizerExtTest.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,16 @@ public void shouldTokenizeEmptyPayloadWithNewline() {
9191

9292
@Test
9393
public void shouldNotChangeEncodingOfTokensAfterPartitioning() {
94-
RubyString rubyString = RubyString.newString(RUBY, new byte[]{(byte) 0xA3}); // £ character
94+
// RubyString rubyString = RubyString.newString(RUBY, new byte[]{(byte) 0xA3}); // £ character
95+
RubyString rubyString = RubyString.newString(RUBY, new byte[]{(byte) 0xA3, 0x0A, 0x41}); // £ character, newline, A
9596
IRubyObject rubyInput = rubyString.force_encoding(context, RUBY.newString("ISO8859-1"));
96-
sut.extract(context, rubyInput);
97+
RubyArray<RubyString> tokens = (RubyArray<RubyString>)sut.extract(context, rubyInput);
98+
IRubyObject firstToken = tokens.shift(context);
9799

98-
IRubyObject token = sut.flush(context);
100+
// IRubyObject token = sut.flush(context);
99101

100-
assertEquals((byte) 0xA3, token.asJavaString().getBytes()[0]);
102+
// assertEquals((byte) 0xA3, token.asJavaString().getBytes()[0]);
103+
// assertEquals("£", token.asJavaString());
104+
assertEquals("£", firstToken.toString());
101105
}
102106
}

0 commit comments

Comments
 (0)