Skip to content

Commit

Permalink
Add failing copyCurrentEvent test.
Browse files Browse the repository at this point in the history
  • Loading branch information
htmldoug committed Dec 20, 2021
1 parent 33a4c64 commit 1cb5dfb
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class JsonParserGeneratorTest
extends BaseTest {
final JsonFactory JSON_F = newStreamFactory();

public void testRoundtripBigDecimal() throws Exception {
public void testCopyCurrentEventBigDecimal() throws Exception {
String input = "1e999";
JsonParser parser = JSON_F.createParser(input);
parser.nextToken();
Expand All @@ -24,4 +24,17 @@ public void testRoundtripBigDecimal() throws Exception {
String actual = stringWriter.toString();
assertEquals(input, actual);
}

public void testCopyCurrentStructureBigDecimal() throws Exception {
String input = "[1e999]";
JsonParser parser = JSON_F.createParser(input);
parser.nextToken();
StringWriter stringWriter = new StringWriter();
JsonGenerator generator = JSON_F.createGenerator(stringWriter);
generator.copyCurrentStructure(parser);
parser.close();
generator.close();
String actual = stringWriter.toString();
assertEquals(input, actual);
}
}

0 comments on commit 1cb5dfb

Please sign in to comment.