Skip to content

In tests, use "text" rather than "literal" as the type for formatted-parts text parts #1060

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

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

eemeli
Copy link
Collaborator

@eemeli eemeli commented Mar 22, 2025

The test suite expParts should not expect message text parts to be formatted as "literal", but as "text". The current type is misleading, given that in our spec literals are a different thing.

@eemeli eemeli added the test-suite Issue pertains to tests label Mar 22, 2025
Copy link
Collaborator

@gibson042 gibson042 left a comment

Choose a reason for hiding this comment

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

The use of "literal" in this spec is already at odds with every ECMA-402 formatToParts method, since the PartitionPattern operation supporting them uses type "literal" for each returned part that is not from a placeholder (such as the parts of Intl.DateTimeFormat output that are not time scale components, e.g. punctuators like "-"/":" or affix characters like "年"/"月"/"日"). However, I agree that the sequences of non-placeholder text in a MessageFormat pattern are distinguished from those implementation-introduced parts (MessageFormat itself operating one level up, since the patterns are supplied by developers rather than internal to the implementation), and support their representation with type "text" as proposed here.

@aphillips aphillips merged commit a305837 into main Mar 24, 2025
2 checks passed
@aphillips aphillips deleted the text-parts branch March 24, 2025 16:40
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.

3 participants