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 sub-delim path tests #34

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

kriswuollett
Copy link
Contributor

@kriswuollett kriswuollett commented Jul 28, 2023

Excluded * since it is known to not be supported yet in #23.

Excluded `*` since it is known to not be supported yet, see ibraheemdev#23.
@ibraheemdev
Copy link
Owner

I'm not sure what the point of these tests are? matchit doesn't do any percent encoding at all, it just looks for literal matches. : and * are the only exception because they are used to mark parameters.

@kriswuollett
Copy link
Contributor Author

kriswuollett commented Jul 28, 2023

I'm not sure what the point of these tests are? matchit doesn't do any percent encoding at all, it just looks for literal matches. : and * are the only exception because they are used to mark parameters.

It adds test coverage to prove that matchit covers sub-delims, i.e. doesn't panic nor return error, as defined in RFC 3986 except for the exceptions that you mention. Currently the only likely other error-prone in URLs character that was covered was ? in:

"/???" :: "/*bar" => { "bar" => "???" },

Since there were multiple /[a-z]+ examples in basic, I thought it would be reasonable to propose making tests to cover all of the defined sub-delims.

It was done in an effort to see if a workaround was possible for #23.

Thanks. It is good to know that matchit doesn't do percent encoding, and so that would be the responsibility of its users.

@ibraheemdev
Copy link
Owner

Alright, that seems reasonable. Thanks!

@ibraheemdev ibraheemdev merged commit 6c58479 into ibraheemdev:master Jul 28, 2023
@kriswuollett kriswuollett deleted the sub-delims-test branch July 28, 2023 20:13
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.

2 participants