Repository navigation
Add tests for escapes, shorthand names, trailing commas and booleans - #121
Merged
gregsdennis merged 1 commit intoOct 13, 2026
Conversation
Nine tests for cases the suite does not cover yet, each of which an implementation got wrong while passing every existing test: - name selector: \u escapes for control characters (\u001f) and with the hex digit e in lower case (\u00e9), in both quote styles - name shorthand: a supplementary plane character ($.😀) is valid, a hyphen ($.a-b) is not - a trailing comma followed by a blank ($[0, ]) is invalid - ordering comparisons between a boolean and a number select nothing Found by differential testing against jsonpath-rfc9535, see jg-rp/python-jsonpath-rfc9535#24, jsonpath-standard#25, jsonpath-standard#26 and jsonpath-standard#27. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
glyn
approved these changes
Oct 12, 2026
glyn
left a comment
Contributor
There was a problem hiding this comment.
These tests look correct to me.
@gregsdennis PTAL
Collaborator
|
I'll run these through my implementation tonight. |
f3ath
approved these changes
Oct 12, 2026
f3ath
left a comment
Collaborator
There was a problem hiding this comment.
Looks good, works with my impl.
Collaborator
|
These all look right to me. I'll run it when I can (probably would highlight a bug in my implementation more than anything wrong here). I think we're good to merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nine tests for cases the suite doesn't cover yet. Differential testing found each of them as a bug in jsonpath-rfc9535, which passes all 706 existing tests. All six bugs are fixed in 2.0.1, thanks to @jg-rp (#24, #25, #26, #27).
$["\u001f"]["A"], path$['\u001f']escapableallows%x75 hexchar, andnon-surrogatecovers0000–001F; only unescaped control characters are excluded (2.3.1.1)$["\u00e9"]["A"]HEXDIGis case-insensitive (RFC 5234). The existing lower-case test (\u263a) only usesa$.😀["A"]name-firstincludes%xE000-10FFFF(2.5.1.1). The existing test ($.☺) stays in the BMP$.a-b-is not aname-char$[0, ]bracketed-selectionneeds a selector after every comma. The existing test$[0,]has no blank$[?@.a>false]ona: 0anda: 1[]<is true only if both values are numbers or both are strings (2.3.5.2.2). The existing boolean tests compare booleans only with booleans and strings$[?@.a<=true]ona: 0anda: 1[]<=is also not true through==cts.jsonis regenerated withbuild.sh. The diff only adds tests.Checked against two implementations: jsonpath-rfc9535 2.0.1 and Treetrail (Java, my implementation) pass all 715 tests, and jsonpath-rfc9535 2.0.0 fails all nine new ones.
🤖 Generated with Claude Code