Skip to content

Commit

Permalink
Fix some missed failing->tofix cases
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 15, 2025
1 parent 74eecd3 commit 132f2e7
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 47 deletions.
10 changes: 0 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,6 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>tools/jackson/**/failing/*.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>

Expand Down
6 changes: 5 additions & 1 deletion yaml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
</properties>

<dependencies>
<!-- Extends Jackson core, databind (optional); uses SnakeYAML for parsing, generation -->
<!-- Extends Jackson core, databind; uses SnakeYAML for parsing, generation -->
<dependency>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package tools.jackson.dataformat.yaml.failing;
package tools.jackson.dataformat.yaml.tofix;

import org.junit.jupiter.api.Test;

import tools.jackson.databind.ObjectMapper;
import tools.jackson.dataformat.yaml.ModuleTestBase;
import tools.jackson.dataformat.yaml.testutil.failure.JacksonTestFailureExpected;

import static org.junit.jupiter.api.Assertions.*;

Expand All @@ -22,10 +25,13 @@ public void setV(Integer v)
}
}

private final ObjectMapper MAPPER = newObjectMapper();

@JacksonTestFailureExpected
@Test
public void testJsonIntegerWithUnderscores() throws Exception
{
ObjectMapper mapper = new ObjectMapper();
IntegerHolder integerHolder = mapper.readValue("{\"v\": \"1_000_000\"}", IntegerHolder.class);
IntegerHolder integerHolder = MAPPER.readValue("{\"v\": \"1_000_000\"}", IntegerHolder.class);
assertNotNull(integerHolder);
assertEquals(Integer.valueOf(1000000), integerHolder.getV());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package tools.jackson.dataformat.yaml.failing;
package tools.jackson.dataformat.yaml.tofix;

import org.junit.jupiter.api.Test;

import tools.jackson.databind.ObjectMapper;

import tools.jackson.dataformat.yaml.ModuleTestBase;
import tools.jackson.dataformat.yaml.YAMLFactory;
import tools.jackson.dataformat.yaml.testutil.failure.JacksonTestFailureExpected;

import static org.junit.jupiter.api.Assertions.*;

Expand All @@ -24,19 +27,23 @@ public void setV(Long v)
}
}

private final ObjectMapper MAPPER = newObjectMapper();

@JacksonTestFailureExpected
@Test
public void testYamlLongWithUnderscores() throws Exception
{
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
LongHolder longHolder = mapper.readValue("v: 1_000_000", LongHolder.class);
LongHolder longHolder = MAPPER.readValue("v: 1_000_000", LongHolder.class);
assertNotNull(longHolder);
assertEquals(LongHolder.class, longHolder.getClass());
assertEquals(Long.valueOf(1000000), longHolder.getV());
}

@JacksonTestFailureExpected
@Test
public void testJsonLongWithUnderscores() throws Exception
{
ObjectMapper mapper = new ObjectMapper();
LongHolder longHolder = mapper.readValue("{\"v\": \"1_000_000\"}", LongHolder.class);
LongHolder longHolder = MAPPER.readValue("{\"v\": \"1_000_000\"}", LongHolder.class);
assertNotNull(longHolder);
assertEquals(Long.valueOf(1000000), longHolder.getV());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package tools.jackson.dataformat.yaml.failing;
package tools.jackson.dataformat.yaml.tofix;

import java.math.BigInteger;

import org.junit.jupiter.api.Test;

import tools.jackson.databind.ObjectMapper;
import tools.jackson.dataformat.yaml.ModuleTestBase;
import tools.jackson.dataformat.yaml.testutil.failure.JacksonTestFailureExpected;

import static org.junit.jupiter.api.Assertions.assertEquals;

Expand All @@ -32,6 +33,7 @@ static class BigHolder {
private final ObjectMapper MAPPER = newObjectMapper();

// [dataformats-text#71]
@JacksonTestFailureExpected
@Test
public void testDeserHexInt71() throws Exception
{
Expand All @@ -46,6 +48,7 @@ public void testDeserHexInt71() throws Exception
_verifyNumber(new BigInteger("-11112222333344445555ACDC", 16), "-0x11112222333344445555acdc");
}

@JacksonTestFailureExpected
@Test
public void testDeserHexUnderscores() throws Exception
{
Expand All @@ -57,6 +60,7 @@ public void testDeserHexUnderscores() throws Exception
_verifyNumber(-Long.parseLong("12345678c0", 16), "-0x12_3456_78c0");
}

@JacksonTestFailureExpected
@Test
public void testDeserOctal() throws Exception
{
Expand All @@ -71,6 +75,7 @@ public void testDeserOctal() throws Exception
_verifyNumber(new BigInteger("-123456771234567712345677", 8), "-0123456771234567712345677");
}

@JacksonTestFailureExpected
@Test
public void testDeserOctalUnderscores() throws Exception
{
Expand All @@ -82,6 +87,7 @@ public void testDeserOctalUnderscores() throws Exception
_verifyNumber(-Long.parseLong("1234567712345677", 8), "-01_234_567_712_345_677");
}

@JacksonTestFailureExpected
@Test
public void testDeserBinary() throws Exception
{
Expand All @@ -90,6 +96,7 @@ public void testDeserBinary() throws Exception
_verifyNumber(-Integer.parseInt("1010", 2), "-0b1010");
}

@JacksonTestFailureExpected
@Test
public void testDeserBinaryUnderscores() throws Exception
{
Expand All @@ -102,6 +109,7 @@ public void testDeserBinaryUnderscores() throws Exception
// least not yet, due to likely backwards-compatibility issues
// with IP numbers
/*
@JacksonTestFailureExpected
@Test
public void testDeserBase60() throws Exception
{
Expand Down

0 comments on commit 132f2e7

Please sign in to comment.