-
Notifications
You must be signed in to change notification settings - Fork 497
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix writeDateYYYMMDD10 error, for issue #1497
- Loading branch information
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
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
24 changes: 24 additions & 0 deletions
24
core/src/test/java/com/alibaba/fastjson2/issues_1000/Issue1497.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,24 @@ | ||
package com.alibaba.fastjson2.issues_1000; | ||
|
||
import com.alibaba.fastjson2.JSONWriter; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class Issue1497 { | ||
@Test | ||
public void testUTF8() { | ||
JSONWriter jsonWriter = JSONWriter.ofUTF8(); | ||
jsonWriter.writeDateYYYMMDD10(1921, 12, 13); | ||
assertEquals("\"1921-12-13\"", jsonWriter.toString()); | ||
jsonWriter.close(); | ||
} | ||
|
||
@Test | ||
public void testUTF16() { | ||
JSONWriter jsonWriter = JSONWriter.ofUTF16(); | ||
jsonWriter.writeDateYYYMMDD10(1921, 12, 13); | ||
assertEquals("\"1921-12-13\"", jsonWriter.toString()); | ||
jsonWriter.close(); | ||
} | ||
} |