Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test that Joining_Group refines Joining_Type #439

Merged
merged 3 commits into from
May 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,35 @@ public void TestAAScripts() {
}
}

@Test
public void TestJoiningGroupConsistency() {
// TODO(egg): I would like to be able to put that in the invariants tests as « the partition
// defined by Joining_Group is finer than that defined by Joining_Type ».
UnicodeMap<String> joiningGroup = iup.load(UcdProperty.Joining_Group);
UnicodeMap<String> joiningType = iup.load(UcdProperty.Joining_Type);
var charactersByJoiningGroup = new HashMap<String, UnicodeSet>();
joiningGroup.addInverseTo(charactersByJoiningGroup).remove("No_Joining_Group");
charactersByJoiningGroup.forEach(
(group, set) -> {
final int first = set.getRangeStart(0);
final String firstType = joiningType.get(first);
set.forEach(
(c) -> {
assertEquals(
"U+"
+ getCodeAndName(Character.toString(first))
+ "\nand\nU+"
+ getCodeAndName(c)
+ "\nhave different joining types but are in the"
+ " same joining group ("
+ group
+ ")\n",
firstType,
joiningType.get(c));
});
});
}

@Test
public void TestScripts() {

Expand Down