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

CLDR-17088 Flesh out en.xml; new test for null/blank/inheritance-marker #3444

Closed
wants to merge 2 commits into from

Conversation

btangmu
Copy link
Member

@btangmu btangmu commented Jan 8, 2024

-New TestEnInheritance.java

CLDR-17088

  • This PR completes the ticket.

ALLOW_MANY_COMMITS=true

@btangmu btangmu self-assigned this Jan 8, 2024
@Test
void testEn() {
final CLDRConfig config = CLDRConfig.getInstance();
final CLDRFile cldrFile = config.getCLDRFile(LOCALE_ID, true);
Copy link
Member

Choose a reason for hiding this comment

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

This is getting the resolved value, so the results will not be accurate.

Copy link
Member Author

Choose a reason for hiding this comment

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

Second commit changes resolving from true to false

String value = cldrFile.getStringValue(path);
if (value == null) {
complain("null value", ++pathsWithNullValue, path);
} else if (value.isBlank()) {
Copy link
Member

Choose a reason for hiding this comment

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

There are a few values that can be blank, so they would need to be excluded. I can't remember if these are marked in the DTD or not; if not, we might consider that so that they can be tested with DtdData.

Copy link
Member Author

Choose a reason for hiding this comment

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

nativeSpaceReplacement and foreignSpaceReplacement and ...?

Copy link
Member Author

Choose a reason for hiding this comment

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

The second commit adds exclusions for nativeSpaceReplacement and foreignSpaceReplacement based on their constants DisplayAndInputProcessor.FSR_START_PATH/NSR_START_PATH -- not sure how we'd use the DTD...?

@btangmu
Copy link
Member Author

btangmu commented Jan 8, 2024

Locally this (first commit) results in these errors, and I expect it to have the same errors here:

[INFO] Running org.unicode.cldr.test.TestEnInheritance
Jan 08, 2024 1:07:39 PM org.unicode.cldr.test.TestEnInheritance complain
SEVERE: TestEnInheritance -- blank value 1 //ldml/personNames/nativeSpaceReplacement
Jan 08, 2024 1:07:39 PM org.unicode.cldr.test.TestEnInheritance complain
SEVERE: TestEnInheritance -- blank value 2 //ldml/personNames/foreignSpaceReplacement
Jan 08, 2024 1:07:39 PM org.unicode.cldr.test.TestEnInheritance complain
SEVERE: TestEnInheritance -- null value 1 //ldml/dates/timeZoneNames/metazone[@type="Gulf"]/short/standard
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.085 s <<< FAILURE! - in org.unicode.cldr.test.TestEnInheritance
[ERROR] org.unicode.cldr.test.TestEnInheritance.testEn  Time elapsed: 0.084 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: null values ==> expected: <0> but was: <1>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)

The ticket specifies "blank" values as problematic, but maybe that's not to be taken literally, especially for nativeSpaceReplacement and foreignSpaceReplacement?

Also there's a null value for one path, the Gulf time zone.

There are no occurrences of INHERITANCE_MARKER (in Modern-coverage paths).

-New TestEnInheritance.java

-Use non-resolving CLDRFile

-Allow blank for foreignSpaceReplacement, nativeSpaceReplacement
@btangmu
Copy link
Member Author

btangmu commented Jan 8, 2024

Second commit running locally gets no more "blank" errors, still gets the Gulf time zone "null" error, and gets 155 new "null" errors for currencies including //ldml/numbers/currencies/currency[@type="BND"]/symbol

Still no INHERITANCE_MARKER errors

@Test
void testEn() {
final CLDRConfig config = CLDRConfig.getInstance();
final CLDRFile cldrFile = config.getCLDRFile(LOCALE_ID, false);
Copy link
Member

Choose a reason for hiding this comment

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

Also, you need to check on this. We need to hit not only the main directory, but also the annotations directory. I think Factory getCommonAndSeedAndMainAndAnnotationsFactory() is the safest.

@macchiati
Copy link
Member

Good. I'm a bit surprised we don't get more of the other items in CODE_FALLBACK besides currency, but that's good news.

@btangmu
Copy link
Member Author

btangmu commented Oct 7, 2024

See #4110

@btangmu btangmu closed this Oct 7, 2024
@btangmu btangmu deleted the t17088_a branch October 7, 2024 12:54
@btangmu btangmu mentioned this pull request Oct 9, 2024
1 task
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