Skip to content

Commit 1171ff2

Browse files
committed
Added a testJapan function in Java tests
This will write a string with wide characters ("state of Japan" copied to Wikipedia), ensuring this is loaded correctly. Also added a testCharArray() that mimics the writing of what is excepted by test_char_array().
1 parent a96bdcd commit 1171ff2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/java/src/test/java/OneTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,25 @@ public void testChars() throws IOException {
196196
oos.close();
197197
}
198198

199+
@Test
200+
public void testCharArray() throws IOException {
201+
char[] array = new char[] {
202+
'\u0000', '\ud800',
203+
'\u0001', '\udc00',
204+
'\u0002', '\uffff',
205+
'\u0003'
206+
};
207+
oos.writeObject(array);
208+
oos.close();
209+
}
210+
211+
@Test
212+
public void testJapan() throws IOException {
213+
String stateOfJapan = "日本国";
214+
oos.writeObject(stateOfJapan);
215+
oos.close();
216+
}
217+
199218
@Test
200219
public void testClass() throws Exception {
201220
oos.writeObject(String.class);

0 commit comments

Comments
 (0)