Skip to content
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

Bidi tests rely on assumptions about standard functions #970

Open
catamorphism opened this issue Dec 7, 2024 · 1 comment
Open

Bidi tests rely on assumptions about standard functions #970

catamorphism opened this issue Dec 7, 2024 · 1 comment

Comments

@catamorphism
Copy link
Collaborator

I noticed that the tests where the default bidi strategy is enabled expect numbers not to be isolated, but expect strings to be isolated. For example:

https://github.com/unicode-org/message-format-wg/blob/main/test/tests/bidi.json#L91

    {
        "description": "function-expression = \"{\" o function *(s attribute) o \"}\"",
        "src": "{1 \u200E :number \u200F}",
        "exp": "1"
    }

and

https://github.com/unicode-org/message-format-wg/blob/main/test/tests/u-options.json#L143

 {
      "locale": "ar",
      "src": "أهلاً {بالعالم :string}",
      "exp": "أهلاً \u2068بالعالم\u2069"
    }

In both cases, the function (:number or :string) is called without a u:dir or u:locale option, so I would expect either both to be isolated, or neither to be isolated. The assumption seems to be that the result of a :number gets its directionality from the underlying locale, while the result of a :string has unknown directionality (in the absence of u:dir). This should be documented in the spec.

@aphillips
Copy link
Member

I agree that this might be a bug in the first test quoted, or at least a gap. If msgdir and fmt are both LTR, then you'd expect the output shown. But we don't state the locale or specify what :number will do in this case. Without those, the output should have FSI/PDI around the 1. More documentation is probably needed.

I'll note that the test in question is trying to test whether strong bidi marks can appear in the expression without causing errors.

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

No branches or pull requests

2 participants