Skip to content

Update the test schema to make expErrors "array" only #993

Open
@mihnita

Description

Right now that is an array or a boolean:

"expErrors": {
  "description": "The runtime errors expected to be emitted when formatting the message. If expErrors is either absent or empty, the message must be formatted without errors.",
  "type": [
    "array",
    "boolean"
  ],
  ...

Why:

  1. Something that can be one of two different types makes it harder to consume the json from statically typed languages
  2. It is not useful in any way.
    The description already says "If expErrors is either absent or empty, the message must be formatted without errors". That covers the possible expErrors = false.
    So we already have 2 ways to say "nothing fails", we don't need 3 ways.
    And if we expect an error, then we should say what that error is, not just say "yes, we expect errors" (expErrors = true).

The only use of expErrors as boolean right now is in test/tests/functions/currency.json, and all instances are "expErrors": false.
Which is not needed (as per description missing expErrors means no errors).
And that is what we do in all other tests, we don't specify expErrors when none are expected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    LDML47LDML 47 Release (Stable)resolve-candidateThis issue appears to have been answered or resolved, and may be closed soon.test-suite

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions