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 more tests for invalid escape sequences #86

Merged

Conversation

Marcono1234
Copy link
Contributor

Covers escape sequences which are allowed in some programming languages (e.g. C++ and Python), but which are not valid for JSONPath.

Also adds two test for incomplete \u escapes.

I only added these tests for double quoted selectors, but in theory they also apply to single quoted strings (and filters?). But I am not sure if it is really worth duplicating them.

This is `\LF`, a `\` at the end of the line (used by some programming
languages to wrap a line); it is not `\\n`.
Copy link
Collaborator

@gregsdennis gregsdennis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look good to me. Thanks for submitting them.

My implementation had a bug in that, while it wasn't accepting these, it was throwing an exception instead of merely saying the path is bad. (Wrong error issue.)

Copy link
Collaborator

@f3ath f3ath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass on my implementation.

@gregsdennis gregsdennis merged commit 651dcb8 into jsonpath-standard:main Aug 1, 2024
2 checks passed
@Marcono1234 Marcono1234 deleted the invalid-escape-sequences branch August 1, 2024 21:49
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.

3 participants