22
22
23
23
@ SuppressWarnings ("OctalInteger" )
24
24
public class ParserTest {
25
- private final ParserOptions testOptions = new ParserOptions (false );
26
25
private final ObjectMapper jsonMapper = JsonMapper .builder ()
27
26
.enable (DeserializationFeature .USE_BIG_DECIMAL_FOR_FLOATS )
28
27
.enable (JsonReadFeature .ALLOW_NON_NUMERIC_NUMBERS )
@@ -33,10 +32,10 @@ private ObjectNode json(@Language("json") String json) {
33
32
}
34
33
35
34
private ObjectNode toml (@ Language ("toml" ) String toml ) throws IOException {
36
- return toml (testOptions , toml );
35
+ return toml (0 , toml );
37
36
}
38
37
39
- private ObjectNode toml (ParserOptions opts , @ Language ("toml" ) String toml ) throws IOException {
38
+ private ObjectNode toml (int opts , @ Language ("toml" ) String toml ) throws IOException {
40
39
return Parser .parse (new JacksonTomlParseException .ErrorContext (null , null ), opts , new StringReader (toml ));
41
40
}
42
41
@@ -896,7 +895,7 @@ public void intTypes() throws IOException {
896
895
.put ("int1" , 99 )
897
896
.put ("int2" , 4242424242L )
898
897
.put ("int3" , new BigInteger ("171717171717171717171717" )),
899
- toml (new ParserOptions ( false ), "int1 = +99\n " +
898
+ toml ("int1 = +99\n " +
900
899
"int2 = 4242424242\n " +
901
900
"int3 = 171717171717171717171717" )
902
901
);
@@ -911,7 +910,7 @@ public void longBase() throws IOException {
911
910
.put ("hex3" , 0xddead_beefL )
912
911
.put ("oct1" , 01234567777777L )
913
912
.put ("bin1" , 0b11010110101010101010101010101010101010L),
914
- toml (new ParserOptions ( false ), "hex1 = 0xdDEADBEEF\n " +
913
+ toml ("hex1 = 0xdDEADBEEF\n " +
915
914
"hex2 = 0xddeadbeef\n " +
916
915
"hex3 = 0xddead_beef\n " +
917
916
"oct1 = 0o1234567777777\n " +
@@ -928,7 +927,7 @@ public void bigintBase() throws IOException {
928
927
.put ("hex3" , new BigInteger ("DDEADBEEFDDEADBEEF" , 16 ))
929
928
.put ("oct1" , new BigInteger ("12345677777771234567777777" , 8 ))
930
929
.put ("bin1" , new BigInteger ("1101011010101010101010101010101010101011010110101010101010101010101010101010" , 2 )),
931
- toml (new ParserOptions ( false ), "hex1 = 0xDDEADBEEFDDEADBEEF\n " +
930
+ toml ("hex1 = 0xDDEADBEEFDDEADBEEF\n " +
932
931
"hex2 = 0xddeadbeefddeadbeef\n " +
933
932
"hex3 = 0xddead_beefddead_beef\n " +
934
933
"oct1 = 0o12345677777771234567777777\n " +
@@ -939,7 +938,7 @@ public void bigintBase() throws IOException {
939
938
@ Test
940
939
public void javaTimeDeser () throws IOException {
941
940
// this is the same test as above, except with explicit java.time deserialization
942
- ParserOptions options = new ParserOptions ( true );
941
+ int options = TomlReadFeature . PARSE_JAVA_TIME . getMask ( );
943
942
944
943
Assert .assertEquals (
945
944
JsonNodeFactory .instance .objectNode ()
0 commit comments