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

Add tests to ensure Unicode string comparison is by codepoint - Issue #570 #735

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zaplapl
Copy link

@zaplapl zaplapl commented Apr 14, 2024

Commit motivated by discussion with @Julian here

@gregsdennis
Copy link
Member

I'm pretty sure we already have these kinds of tests. See minLength and maxLength.

These tests are checking the JSON parser, not JSON Schema.

I can provide links in the morning.

@zaplapl
Copy link
Author

zaplapl commented Apr 20, 2024

thanks for your comment @gregsdennis

as far as I can tell, the test cases you mention are different

to me this highlights that the way length is calculated for strings is different than the spec's directive on establishing identity/equality for strings

the reason I thought to put these cases in the tests for const is that it's the place where it makes the most sense to speak the schema validator evaluating equality for two strings

the issue of length might just be separate - and out of scope for the original issue

that is, it may be an issue (for this test suite) that a schema with a string field with maxLength 1 essentially accepts unbounded zalgo input since that may count as a single grapheme - but that seems like it's a consideration that is out of scope for the issue as it was originally raised - and doesn't affect the (in)correctness of this particular change

but maybe I've misunderstood

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

Successfully merging this pull request may close these issues.

None yet

2 participants