-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Move test of \a regex character to optional/format/regex #740
Move test of \a regex character to optional/format/regex #740
Conversation
This doesn't really seem correct to me. The |
We already put format tests in optional/ because it's understood that full specification adherence is spotty. If the ECMA spec says that this string is a valid (or invalid) pattern, then it belongs in this file (optional/format/regex.json). The test definitely does not belong where it is currently because formats are never invalid using the draft2020-12 metaschema dialect, because formats are only annotations there. |
Reasons I think this test belongs where this PR moves it:
Discussed a few days ago with @karenetheridge on slack, for reference, though I think I've made the same points here. https://json-schema.slack.com/archives/C8CQ81GKF/p1713142486362639 |
We've recently decided that meta-schema tests are not really in scope for this suite.
The spec provides allowance to validate What I would be open to is creating a set of required I agree with the changes proposed by this PR. |
Those sound like good reasons to fix/modify the test, and not good reasons to move the test to me, but do as y'all wish. |
This does modify the test, as well as moving it to a more appropriate location. I'm not sure what else would be more of an improvement. |
It moves it to a strictly worse location, because it moves it from a file that is "tests for ECMA dialect regexes" to one that is not and is meant to be run across multiple possible regular expression dialects. |
I can leave the test where it is - that part doesn't matter to my test harness, anyway - but do you agree that testing with I do still think it has more in common with |
Yes.
Happy to do this, but then can you point me at which ones you mean here, I'm happy to respond, but none of the ones I saw had anything to do with where the test was located, which is exactly why I commented with what I did.
Yes I agree. |
I mean I guess just to directly comment on each one since those are the only ones here:
This certainly doesn't seem to have anything to do with which file it belongs in to me.
This seems like we simply haven't had any tests of an invalid regex, and now we do.
This again seems to have nothing to do with what file it's in and simply is commenting on the test being wrong in 2020.
(This again doesn't have to do with what file the test is in though since you mention it, this is precisely why this test was fine in versions pre-2019 -- and why it's really a simple documentation issue for 2019 + 2020 at which point they'd be valid even where they are. But I'm honestly tired of that discussion, which is why it's easier to just say "sure change it".) |
20d15a8
to
cbd48ea
Compare
Thanks, Julian. I moved it back and rebased. |
I didn't do anything but quibble really, no need to thank me :) but this lgtm now too. |
I think you're right that it was fine where it is, and appreciate the time you took saying why. |
Ok I'm gonna merge given it looks like others were already ok with this but if for whatever reason anyone thinks it was better before or something we can address. Thanks again! |
I just came across this change again while testing my implementation. I will repeat my objections earlier, that the location of this test is wrong: it is using the We've repeatedly acknowledged that the use of optional/ is a bit vague for specifying different expected behaviour, but the convention is that format-assertion tests should be in optional/format. Deviating from this requires that an implementation's test suite needs to special-case other files under optional/ (or even specific tests in those files) in a way that they haven't before. This convention is documented: see item 2 at https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/main/README.md#additional-assumptions. |
This ECMA 262 test returned false previously because it used a $ref to another document (unsupported); now it returns true because of different handling of regex dialects. However, the test really should live in optional/format - see json-schema-org/JSON-Schema-Test-Suite#740 (comment)
@karenetheridge I'm confused. You're arguing that the tests should be in What are you objecting to? |
According to item 2 at https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/main/README.md#additional-assumptions, only tests under How about: #751 |
This was validating "\a" as a schema
pattern
described by the meta-schema asformat: regex
. This moves it to directly test the pattern against aformat: regex
schema.related: e42e8417, #309, json-schema-org/json-schema-spec#821