Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/test/java/com/alibaba/json/bvt/issue_3500/Issue3579.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.alibaba.json.bvt.issue_3500; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
import com.alibaba.fastjson.serializer.SerializerFeature; | ||
import junit.framework.TestCase; | ||
|
||
import java.math.BigDecimal; | ||
|
||
public class Issue3579 extends TestCase { | ||
public void test_for_issue() throws Exception { | ||
assertEquals("1", | ||
JSON.toJSONString(new BigDecimal("1")) | ||
); | ||
|
||
assertEquals("1.", | ||
JSON.toJSONString(new BigDecimal("1"), SerializerFeature.WriteClassName) | ||
); | ||
} | ||
} |