In tests, use "text" rather than "literal" as the type for formatted-parts text parts#1060
In tests, use "text" rather than "literal" as the type for formatted-parts text parts#1060
Conversation
There was a problem hiding this comment.
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.
The test suite
expPartsshould 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.