Skip to content

Commit

Permalink
Add table of errors to test README (unicode-org#706)
Browse files Browse the repository at this point in the history
  • Loading branch information
catamorphism committed Jul 30, 2024
1 parent 4514e88 commit 32214af
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ These test files are intended to be useful for testing multiple different messag

- `syntax-errors.json` — Strings that should produce a Syntax Error when parsed.

- `data-model-errors.json` - Strings that should produce Data Model Error when processed.
- `data-model-errors.json` - Strings that should produce a Data Model Error when processed.
Error names are defined in ["MessageFormat 2.0 Errors"](../spec/errors.md) in the spec.

- `functions/` — Test cases that correspond to built-in functions.
Expand All @@ -24,6 +24,33 @@ A [JSON schema](./schemas/) is included for the test files in this repository.

For users of Visual Studio Code, a [settings file](./.vscode/settings.json) is included that enables schema validation while editing the test files.

## Error Codes

The following table relates the error names used in the [JSON schema](./schemas/)
to the error names used in ["MessageFormat 2.0 Errors"](../spec/errors.md) in the spec.

| Schema | Spec |
| --------------------------- | --------------------------- |
| bad-operand | Bad Operand |
| bad-option | Bad Option |
| bad-selector | Bad Selector |
| bad-variant-key | Bad Variant Key |
| duplicate-declaration | Duplicate Declaration |
| duplicate-option-name | Duplicate Option Name |
| missing-fallback-variant | Missing Fallback Variant |
| missing-selector-annotation | Missing Selector Annotation |
| syntax-error | Syntax Error |
| unknown-function | Unknown Function |
| unresolved-variable | Unresolved Variable |
| unsupported-expression | Unsupported Expression |
| unsupported-statement | Unsupported Statement |
| variant-key-mismatch | Variant Key Mismatch |

The "Message Function Error" error name used in the spec
is not included in the schema,
as it is intended to be an umbrella category
for implementation-specific errors.

## Test Functions

As the behaviour of some of the default registry _functions_
Expand Down

0 comments on commit 32214af

Please sign in to comment.