package org.jcodings.specific;

import org.junit.Test;

import static junit.framework.Assert.*;

public class TestUnicode {
    @Test
    public void testUnicodeLength() throws Exception {
        byte[] utf8Bytes = "mØØse".getBytes("UTF-8");

        assertEquals(7, utf8Bytes.length);
        assertEquals(5, UTF8Encoding.INSTANCE.strLength(utf8Bytes, 0, 7));
        assertEquals(2, UTF8Encoding.INSTANCE.length(utf8Bytes[1]));
        assertEquals('Ø', UTF8Encoding.INSTANCE.mbcToCode(utf8Bytes, 1, 3));
    }
}

@@ -25,16 +25,46 @@
 cific;%0A%0A
+import org.jcodings.Encoding;%0A
 import o
@@ -536,11 +536,440 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testUnicodeProperties() throws Exception %7B%0A        Encoding enc = UTF16BEEncoding.INSTANCE;%0A        byte%5B%5Dstr = %22%5C000B%5C000%5C000%22.getBytes(%22iso-8859-1%22);%0A        int code = enc.mbcToCode(str, 0, str.length);%0A        byte%5B%5Dprop = %22%5C000u%5C000p%5C000p%5C000e%5C000r%22.getBytes(%22iso-8859-1%22);%0A        int ctype = enc.propertyNameToCType(prop, 0, prop.length);%0A        assertTrue(enc.isCodeCType(code, ctype));%0A    %7D
 %0A%7D%0A

add test for unicode property