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

Enumerated property completeness tests #4645

Merged
merged 14 commits into from
Mar 10, 2024

Conversation

kartva
Copy link
Member

@kartva kartva commented Mar 1, 2024

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.

Example output on modifying Wide = EastAsianWidth(2); //name="W" to EastAsianWidth(52):

Values defined in data do not match values defined in consts. Difference (value, data name, const name):
 [(5, Some("W"), None), (52, None, Some("Wide"))]

@kartva kartva requested a review from a team as a code owner March 1, 2024 04:52
@CLAassistant
Copy link

CLAassistant commented Mar 1, 2024

CLA assistant check
All committers have signed the CLA.

@kartva kartva marked this pull request as draft March 1, 2024 04:53
@kartva kartva marked this pull request as ready for review March 1, 2024 05:11
Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

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

Nice work!

components/properties/src/props.rs Show resolved Hide resolved
components/properties/src/props.rs Outdated Show resolved Hide resolved
components/properties/src/props.rs Outdated Show resolved Hide resolved
components/properties/src/props.rs Outdated Show resolved Hide resolved
@kartva
Copy link
Member Author

kartva commented Mar 5, 2024

Example failing test output:

Values defined in data do not match values defined in consts. Difference:
[
    Data:       "Narrow":       4,
    Data:       "Wide": 5,
    Consts:     "Wide": 52,
]

@sffc sffc self-requested a review March 5, 2024 17:39
sffc
sffc previously approved these changes Mar 5, 2024
components/properties/src/props.rs Outdated Show resolved Hide resolved
sffc
sffc previously approved these changes Mar 6, 2024
components/properties/src/props.rs Outdated Show resolved Hide resolved
Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

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

Nice work!

@sffc sffc merged commit 4f6451b into unicode-org:main Mar 10, 2024
30 checks passed
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.

Create test that property open enums stay in sync with ICU
4 participants