// 1. Check that the current 12.1 spec file is handled by the current // version of Character.
File unicodeSpec = UCDFiles.UNICODE_DATA.toFile(); for (int x = 0; x < 16; ++x) { int diffs = CharCheck.check(x, unicodeSpec); if (diffs != 0) { thrownew RuntimeException("Unicode properties have changed " + "in an unexpected way");
}
}
// 2. Check that Java identifiers are recognized correctly. // test a few characters that are good id starts char[] idStartChar = {'$', '\u20AC', 'a', 'A', 'z', 'Z', '_', '\u0E3F', '\u1004', '\u10A0', '\u3400', '\u4E00', '\uAC00' }; for (int x = 0; x < idStartChar.length; x++) { if (Character.isJavaIdentifierStart(idStartChar[x]) != true) { thrownew RuntimeException("Java id start characters are not recognized.");
}
}
// test a few characters that are good id parts char[] idPartChar = {'0', '9', '\u0000', '\u0008', '\u000E', '\u007F'}; for (int x=0; x< idStartChar.length; x++) { if (Character.isJavaIdentifierPart(idStartChar[x]) != true) { thrownew RuntimeException("Java id part characters are not recognized.");
}
} for (int x=0; x<idPartChar.length; x++) { if (Character.isJavaIdentifierPart(idPartChar[x]) != true) { thrownew RuntimeException("Java id part characters are not recognized.");
}
}
// now do some negative checks for (int x=0; x< idPartChar.length; x++) { if (Character.isJavaIdentifierStart(idPartChar[x]) != false) { thrownew RuntimeException("These Java id part characters" + "should not be start characters.");
}
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-09-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.