File tree 1 file changed +11
-0
lines changed
test/org/jcodings/specific
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -59,4 +59,15 @@ public void testCaseMap() throws Exception {
59
59
assertTrue (caseMap ("aäböcü" , Config .CASE_UPCASE | Config .CASE_ASCII_ONLY ).equals ("AäBöCü" ));
60
60
assertTrue (caseMap ("AÄBÖCÜ" , Config .CASE_DOWNCASE | Config .CASE_ASCII_ONLY ).equals ("aÄbÖcÜ" ));
61
61
}
62
+
63
+ @ Test
64
+ public void testCodeToMbcLength () throws Exception {
65
+ assertEquals (enc .codeToMbcLength (0x01 ), 1 );
66
+ assertEquals (enc .codeToMbcLength (0x7f ), 1 );
67
+ assertEquals (enc .codeToMbcLength (0x101 ), 2 );
68
+ assertEquals (enc .codeToMbcLength (0x1020 ), 3 );
69
+ assertEquals (enc .codeToMbcLength (0x1F608 ), 4 );
70
+ assertEquals (enc .codeToMbcLength (0xfffffffe ), 1 ); // USE_INVALID_CODE_SCHEME
71
+ assertEquals (enc .codeToMbcLength (0xffffffff ), 1 ); // USE_INVALID_CODE_SCHEME
72
+ }
62
73
}
You can’t perform that action at this time.
0 commit comments