Skip to content

Commit 0af3c4d

Browse files
committedDec 15, 2017
add test for unicode property
1 parent 9cb42f5 commit 0af3c4d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎test/org/jcodings/specific/TestUnicode.java

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.jcodings.specific;
22

3+
import org.jcodings.Encoding;
34
import org.junit.Test;
45

56
import static junit.framework.Assert.*;
@@ -14,4 +15,14 @@ public void testUnicodeLength() throws Exception {
1415
assertEquals(2, UTF8Encoding.INSTANCE.length(utf8Bytes[1]));
1516
assertEquals('Ø', UTF8Encoding.INSTANCE.mbcToCode(utf8Bytes, 1, 3));
1617
}
18+
19+
@Test
20+
public void testUnicodeProperties() throws Exception {
21+
Encoding enc = UTF16BEEncoding.INSTANCE;
22+
byte[]str = "\000B\000\000".getBytes("iso-8859-1");
23+
int code = enc.mbcToCode(str, 0, str.length);
24+
byte[]prop = "\000u\000p\000p\000e\000r".getBytes("iso-8859-1");
25+
int ctype = enc.propertyNameToCType(prop, 0, prop.length);
26+
assertTrue(enc.isCodeCType(code, ctype));
27+
}
1728
}

0 commit comments

Comments
 (0)