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

Add more canonical equivalence tests #42

Merged

Conversation

Jules-Bertholet
Copy link
Contributor

Test that all canonically equivalent sequences in Unicode's NormalizationTest.txt have the same width.

Currently no changes need to be made to the width logic to ensure these tests pass. However, Unicode 16 is adding a few new characters that will be problematic (the Kirat Rai vowel signs: https://www.unicode.org/charts/PDF/Unicode-16.0/U160-16D40.pdf). Adding this test in advance ensures that we won't forget to account for these changes when the time comes.

Test that all canonically equivalent sequences
in Unicode's `NormalizationTest.txt` have the same width.
Currently no changes need to be made to the width logic
to ensure these tests pass. However, Unicode 16
is adding a few new characters that will be problematic
(the Kirat Rai vowel signs:
<https://www.unicode.org/charts/PDF/Unicode-16.0/U160-16D40.pdf>).
Adding this test in advance ensures that we won't forget
to account for these changes when the time comes.
The new test subsumes it
Ensures CI will keep passing until we choose to update
tests/tests.rs Outdated
let mut nfd = String::new();
unicode_normalization::char::decompose_canonical(c, |d| nfd.push(d));
let norm_file = BufReader::new(
File::open("scripts/NormalizationTest.txt")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: I'd prefer to check in the file if it's used in tests.

@Manishearth
Copy link
Member

CI fails

@Manishearth Manishearth merged commit 74c8394 into unicode-rs:master Apr 30, 2024
2 checks passed
@Jules-Bertholet Jules-Bertholet deleted the more-normalization-tests branch April 30, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants