Skip to content

Commit

Permalink
factor
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed Jan 7, 2024
1 parent 0c312ce commit 361a977
Showing 1 changed file with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,26 +219,16 @@ public void TestAAScripts() {

@Test
public void TestNFCQuickCheck() {
UnicodeMap<String> nfcqc = iup.load(UcdProperty.NFC_Quick_Check);
String normalizationTest =
org.unicode.text.utility.Utility.getMostRecentUnicodeDataFile(
"NormalizationTest", GenerateEnums.ENUM_VERSION, true, false);
for (String line : FileUtilities.in("", normalizationTest)) {
line = line.trim();
if (line.startsWith("#") || line.startsWith("@Part")) {
continue;
}
String[] parts = Arrays.copyOfRange(line.split(";"), 0, 5);
for (String part : parts) {
checkQuickCheck(
Default.nfc(), nfcqc, org.unicode.text.utility.Utility.fromHex(part));
}
}
checkQuickCheckOnNormalizationTest(Default.nfc(), iup.load(UcdProperty.NFC_Quick_Check));
}

@Test
public void TestNFKCQuickCheck() {
UnicodeMap<String> nfkcqc = iup.load(UcdProperty.NFKC_Quick_Check);
checkQuickCheckOnNormalizationTest(Default.nfkc(), iup.load(UcdProperty.NFKC_Quick_Check));
}

private void checkQuickCheckOnNormalizationTest(
Normalizer normalizer, UnicodeMap<String> isAllowed) {
String normalizationTest =
org.unicode.text.utility.Utility.getMostRecentUnicodeDataFile(
"NormalizationTest", GenerateEnums.ENUM_VERSION, true, false);
Expand All @@ -250,7 +240,7 @@ public void TestNFKCQuickCheck() {
String[] parts = Arrays.copyOfRange(line.split(";"), 0, 5);
for (String part : parts) {
checkQuickCheck(
Default.nfkc(), nfkcqc, org.unicode.text.utility.Utility.fromHex(part));
normalizer, isAllowed, org.unicode.text.utility.Utility.fromHex(part));
}
}
}
Expand Down

0 comments on commit 361a977

Please sign in to comment.