-
Notifications
You must be signed in to change notification settings - Fork 182
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
Create test that property open enums stay in sync with ICU #4283
Comments
I've observed the following:
We want to find the highest value in the consts defined on the public interface (eg. We can define a macro to go through the defined constants and find the highest value in them. Am I on the right track? |
Hello @sffc, if I'm getting this right: The test needs to throw an error, in case Furthermore for:
Also should I create a new test file? Thanks, PS: |
@ashu26jha |
Surely! I won't mind if you take on this issue. Since I do have put a little bit of time I would happily review your PR if you don't mind :P Cheers! |
Hi @DesmondWillowbrook @ashu26jha! Loading the data via If you need to use a macro, try to keep as little code as possible inside the macro and use helper functions outside of the macro. Most properties are contiguous with no gaps. Canonical_Combining_Class is an exception. Note that properties like Script are contiguous but not in alphabetical order. Suggestion for where to put the test: |
fixes #4283 Description of changes: - Introduced `create_const_array` macro that produces an array of tuples of the values and names of the constants defined in an impl block. - Use this constant to iterate over underlying data and report differences.
Split from #4132
We have property open enums in
components/properties/src/props.rs
. We should make sure these stay up-to-date with ICU for better ergonomics for ICU4X users. Since we use open enums, nothing will break, but users won't be able to use these properties using the nice names in the API.To test this, I would suggest walking a lookup table such as
propnames/from/lb@1
(seeprovider/datagen/tests/data/json/propnames/from/lb@1/und.json
) and ensuring that the largest known open enum value is at least as much as the largest value in the propnames table.The text was updated successfully, but these errors were encountered: