Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

mihnita
Copy link
Collaborator

@mihnita mihnita commented Jun 2, 2025

Fixes issue #993

@mihnita mihnita force-pushed the mihai_issue_933 branch from e0def62 to b0e39a0 Compare June 2, 2025 15:03
@mihnita mihnita force-pushed the mihai_issue_933 branch from b0e39a0 to 3f11bcb Compare June 2, 2025 15:20
@mihnita mihnita requested review from eemeli, mradbourne and aphillips and removed request for eemeli June 2, 2025 15:22
@@ -5,7 +5,7 @@
"defaultTestProperties": {
"bidiIsolation": "none",
"locale": "en-US",
"expErrors": false
"expErrors": []
Copy link
Member

Choose a reason for hiding this comment

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

In fallback.md you left out expErrors. Here you supply an empty array. I think we should probably omit this one?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@aphillips It's required in this file otherwise some tests would be left without an expectation (e.g. lines 44-55). This would also be the case in time.json.

As Eemeli mentioned in his review comment, I think we need to keep the expErrors in fallback.md.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we are talking about fallback.json, not fallback.md?

I updated fallback.json and added errors for each individual case, instead of doing it in defaultTestProperties

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For date.json, datetime.json and time.json I added "expErrors": [] to defaultTestProperties because the schema says that entries are required to have one of exp, expParts or expErrors

In these 3 files we had tests with src only.
So I had to add a expErrors (not enough info for exp, expParts, exact date/time formatting not part of the spec)

@aphillips aphillips added the test-suite Issue pertains to tests label Jun 2, 2025
@aphillips aphillips changed the title Issue 993: make expErrors only Make expErrors use an array (and only an array) Jun 2, 2025
Copy link
Collaborator

@eemeli eemeli left a comment

Choose a reason for hiding this comment

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

Some fixes, may need a second pass later to make sure I caught everything.

@aphillips
Copy link
Member

need to change bad operand to bad option (2025-06-16)

@aphillips aphillips requested a review from eemeli July 1, 2025 14:44
@aphillips
Copy link
Member

In 2025-06-30 call, we agreed to merge this once @eemeli has reviewed positively. Nudging him gently with this comment.

Copy link
Collaborator

@eemeli eemeli left a comment

Choose a reason for hiding this comment

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

There's a test that also needs to be updated to use bad-option.

},
"tests": [
{
"description": "function with unquoted literal operand",
"src": "{42 :test:function fails=format}",
"exp": "{|42|}",
"expParts": [{ "type": "fallback", "source": "|42|" }]
"expParts": [{ "type": "fallback", "source": "|42|" }],
"expErrors": [{ "type": "bad-operand" }]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"expErrors": [{ "type": "bad-operand" }]
"expErrors": [{ "type": "bad-option" }]

Copy link
Member

Choose a reason for hiding this comment

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

Hmm... I found this confusing until I remembered that we agreed to use bad-option to avoid creating a label for message-function-error in the not at all official definition under tests here. Non-WG members won't have the benefit of having been on the telecon when we discussed it 😉

Unlike the other classes of error, MFE can have implementation-defined errors. We should make this clearer in the test suite text so that implementations do not merely ape our selection of bad-option when an internal exception/error occurs. I think it would be okay to commit this, but we need to put more effort into the text in the /tests page to make super clear that bad-option is not required by non-test functions.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed on all counts. I also noticed while implementing this change that we lack a generic error for failures in formatting or selection, which could be due to the operand, options, or the phase of the moon. As in, values for which resolution succeeds, but then the MessageValue.formatToString() or similar call throws an error. It's pretty likely to involve some bad option, but that's not actually guaranteed -- and beyond the scope of this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@aphillips aphillips merged commit 45b7e41 into unicode-org:main Jul 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test-suite Issue pertains to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants