diff --git a/core/src/test/java/com/alibaba/fastjson2/issues_2200/Issue2211.java b/core/src/test/java/com/alibaba/fastjson2/issues_2200/Issue2211.java index 3d4f4fddb6..5f799dfc45 100644 --- a/core/src/test/java/com/alibaba/fastjson2/issues_2200/Issue2211.java +++ b/core/src/test/java/com/alibaba/fastjson2/issues_2200/Issue2211.java @@ -2,6 +2,8 @@ import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONWriter; +import com.alibaba.fastjson2.writer.ObjectWriter; +import com.alibaba.fastjson2.writer.ObjectWriterProvider; import lombok.Getter; import lombok.Setter; import org.junit.jupiter.api.Test; @@ -20,6 +22,14 @@ public void test() { assertEquals("{\"b1\":true,\"d0\":0,\"d1\":1.0,\"n0\":\"0\",\"n1\":\"1\",\"s1\":\"noear\"}", json); } + @Test + public void testNonASM() { + UserDo userDo = new UserDo(); + ObjectWriter objectWriter = new ObjectWriterProvider().getObjectWriter(UserDo.class); + String json = objectWriter.toJSONString(userDo, JSONWriter.Feature.WriteNullNumberAsZero, JSONWriter.Feature.WriteLongAsString); + assertEquals("{\"b1\":true,\"d0\":0,\"d1\":1.0,\"n0\":\"0\",\"n1\":\"1\",\"s1\":\"noear\"}", json); + } + @Getter @Setter public static class UserDo