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

Tests for malformed [Relative] JSON Pointers #48

Open
handrews opened this issue Feb 18, 2023 · 0 comments
Open

Tests for malformed [Relative] JSON Pointers #48

handrews opened this issue Feb 18, 2023 · 0 comments

Comments

@handrews
Copy link
Contributor

I might be missing something because I'm not familiar with hypothesis and how you're using it to generate test cases, but it looks like malformed JP/RJP aren't being covered. I looked at the creation tests and those all seem to test valid forms.

I messed up the regex changes for index adjustment (#47) in an astonishing number of ways before sorting it out, so I wanted to cover those problems. I wrote up some test cases for both regular and relative JSON Pointers in a gist.

These could be handled in a similar way as the evaluation tests. They could even be folded into that by adding a <malformed> outcome and wrapping the construction in a try, but that gets a bit awkward as the starting point and the document to evaluate against are irrelevant. So it's probably better to have a separate data file and test function.

If this seems reasonable, I will submit a PR for it.

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

No branches or pull requests

1 participant