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

Skip to content

Fix unpaired surrogate in test #1072

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 7 commits into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
The tests in the `./tests/` directory were originally copied from the [messageformat project](https://github.com/messageformat/messageformat/tree/11c95dab2b25db8454e49ff4daadb817e1d5b770/packages/mf2-messageformat/src/__fixtures)
and are here relicensed by their original author (Eemeli Aro) under the Unicode License.
# Unicode MessageFormat Test Suite

These test files are intended to be useful for testing multiple different message processors in different ways:
These test files are intended to be useful for testing multiple different _message_ processors in different ways:

- `syntax.json` — Test cases that do not depend on any registry definitions.

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

> [!NOTE]
> Tests for the disallowed uses of unpaired surrogate code points are not included
> because JSON does not permit unpaired surrogate code points.
> If your implementation uses UTF-16 based strings (such as JavaScript `String` or Java `java.lang.String`)
> or otherwise allows unpaired surrogates in text or literals, you will need to implement tests equivalent
> to the following for syntax errors:
> ```json
> {
> "locale": "en-US",
> "src": "{\ud800}",
> "expErrors": [{ "type": "syntax-error" }]
> }
> ```

- `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.

Expand Down Expand Up @@ -192,3 +205,8 @@ except that it cannot be used for selection.

When `:test:format` is used as a _selector_,
the steps under 2.iii. of [Resolve Selectors](/spec/formatting.md#resolve-selectors) are followed.

## About

The tests in the `./tests/` directory were originally copied from the [messageformat project](https://github.com/messageformat/messageformat/tree/11c95dab2b25db8454e49ff4daadb817e1d5b770/packages/mf2-messageformat/src/__fixtures)
and are here relicensed by their original author (Eemeli Aro) under the Unicode License.
1 change: 0 additions & 1 deletion test/tests/syntax-errors.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@
{ "src": "{^.}" },
{ "src": "{^ .}" },
{ "src": "{&}" },
{ "src": "{\ud800}" },
{ "src": "{\ufdd0}" },
{ "src": "{\ufffe}" },
{ "src": "{!.\\{}" },
Expand Down