Skip to content

Commit

Permalink
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/org/jcodings/specific/TestUnicode.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jcodings.specific;

import org.jcodings.Encoding;
import org.junit.Test;

import static junit.framework.Assert.*;
@@ -14,4 +15,14 @@ public void testUnicodeLength() throws Exception {
assertEquals(2, UTF8Encoding.INSTANCE.length(utf8Bytes[1]));
assertEquals('Ø', UTF8Encoding.INSTANCE.mbcToCode(utf8Bytes, 1, 3));
}

@Test
public void testUnicodeProperties() throws Exception {
Encoding enc = UTF16BEEncoding.INSTANCE;
byte[]str = "\000B\000\000".getBytes("iso-8859-1");
int code = enc.mbcToCode(str, 0, str.length);
byte[]prop = "\000u\000p\000p\000e\000r".getBytes("iso-8859-1");
int ctype = enc.propertyNameToCType(prop, 0, prop.length);
assertTrue(enc.isCodeCType(code, ctype));
}
}

0 comments on commit 0af3c4d

Please sign in to comment.