[serde-gson,serde-hjson,serde-jackson] Unify JSON reader tests
This commit is contained in:
@@ -127,6 +127,26 @@ public class JacksonReader implements TweedDataReader {
|
||||
public long readAsLong() {
|
||||
return longValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReadAsFloat() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float readAsFloat() {
|
||||
return (float) longValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReadAsDouble() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double readAsDouble() {
|
||||
return (double) longValue;
|
||||
}
|
||||
});
|
||||
afterValueRead();
|
||||
return token;
|
||||
|
||||
@@ -5,11 +5,30 @@ import com.fasterxml.jackson.core.StreamReadFeature;
|
||||
import de.siphalor.tweed5.dataapi.api.TweedDataReader;
|
||||
import de.siphalor.tweed5.testutils.serde.json.JsonReaderTest;
|
||||
import lombok.SneakyThrows;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
class JacksonReaderTest implements JsonReaderTest {
|
||||
@Disabled("Jackson does not support integer values with floating point syntax elements")
|
||||
@Override
|
||||
public void jsonByteFloaty(String input, byte expected) {
|
||||
JsonReaderTest.super.jsonByteFloaty(input, expected);
|
||||
}
|
||||
|
||||
@Disabled("Jackson does not support integer values with floating point syntax elements")
|
||||
@Override
|
||||
public void jsonIntFloaty(String input, int expected) {
|
||||
JsonReaderTest.super.jsonIntFloaty(input, expected);
|
||||
}
|
||||
|
||||
@Disabled("Jackson's double precision is abysmal in comparison with everyone else's even with fast double parsing turned off")
|
||||
@Override
|
||||
public void jsonDouble(String input, double expected) {
|
||||
JsonReaderTest.super.jsonDouble(input, expected);
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public TweedDataReader createJsonReader(String text) {
|
||||
|
||||
Reference in New Issue
Block a user