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

Spec tests require non-integer matching #713

Closed
catamorphism opened this issue Mar 8, 2024 · 1 comment · Fixed by #714
Closed

Spec tests require non-integer matching #713

catamorphism opened this issue Mar 8, 2024 · 1 comment · Fixed by #714

Comments

@catamorphism
Copy link
Collaborator

The following tests:

https://github.com/unicode-org/message-format-wg/blob/main/test/test-functions.json#L93

  {
      "src": ".match {$foo :integer} 1.2 {{=1.2}} one {{one}} * {{other}}",
      "params": { "foo": 1.2 },
      "exp": "=1.2"
    },

and

https://github.com/unicode-org/message-format-wg/blob/main/test/test-functions.json#L98

  {
      "src": ".match {$foo :integer} 1.2 {{=1.2}} |1,2| {{=1,2}} * {{other}}",
      "locale": "fr",
      "params": { "foo": 1.2 },
      "exp": "=1.2"
    }

I read through the spec for number selection and there's a note saying that only integer exact matching is required for the tech preview. I'm not sure how to make this work in general, since the spec refers to "the JSON string representation of the numeric value of resolvedSelector" and numbers don't have unique JSON representations. I see that #675 has the goal of discussing this.

But for now, shouldn't these tests be omitted, since, as the spec says, "The exact behavior of exact literal match is only defined for non-zero-filled integer values"?

@eemeli
Copy link
Collaborator

eemeli commented Mar 9, 2024

I agree, these should be dropped.

@catamorphism catamorphism linked a pull request Mar 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants