You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use Jsoniter (v0.9.23) in streaming mode, but our regression suite found an issue, when parsing a json object containing a 0.
Example:
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import com.jsoniter.JsonIterator;
import com.jsoniter.any.Any;
public class JsonIteratorStreamingNotWorkingOnZeroTest {
@Test
public void minimalExampleWithStreaming() {
JsonIterator.enableStreamingSupport();
String json = "{\"a\":0}";
Any any = JsonIterator.deserialize(json);
assertEquals(0, any.get("a").toInt()); // Throws JsonException
}
}
The code above should describe a successful test but fails with a JsonException inside IterImplForStreaming::readByte. That is because it tries to read the next byte after the zero and assert that there isn't any numbers after the 0. But the any api only provides the JsonIterator that contains the 0 and reading the next byte will fail.
The text was updated successfully, but these errors were encountered:
I'm trying to use Jsoniter (v0.9.23) in streaming mode, but our regression suite found an issue, when parsing a json object containing a 0.
Example:
The code above should describe a successful test but fails with a JsonException inside
IterImplForStreaming::readByte
. That is because it tries to read the next byte after the zero and assert that there isn't any numbers after the 0. But the any api only provides the JsonIterator that contains the 0 and reading the next byte will fail.The text was updated successfully, but these errors were encountered: