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 urlparse tests based on wpt url tests (#668) #671

Merged
merged 3 commits into from
Jun 27, 2022
Merged

add urlparse tests based on wpt url tests (#668) #671

merged 3 commits into from
Jun 27, 2022

Conversation

willkg
Copy link
Member

@willkg willkg commented Jun 3, 2022

This adds 20 of the wpt url tests. There are like a thousand of them. We probably should add more, but it needs to be done manually because the parse results have a different shape and theirs factor in a base url. I added comments on some output differences I saw.

"new_value" is a terrible name. I changed it to "noramlized_uri" which
is a bit more along the lines of what it is.
@willkg willkg requested a review from g-k June 3, 2022 14:42
@willkg
Copy link
Member Author

willkg commented Jun 3, 2022

@g-k Is this along the lines of what you were thinking? If you skim through the file, what other ones would be good to add in this pass?

Copy link
Collaborator

@g-k g-k left a comment

Choose a reason for hiding this comment

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

r+ lgtm thanks for tackling this!

path: str = ""
params: str = ""
query: str = ""
fragment: str = ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice! I think this makes the table-based tests cleaner.

Possible future TODO would be to capture errors in this class like a Rust Result, but I guess Python usually avoids that?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, that's a good idea. I'll add a failure test and see how that might work.

@willkg willkg merged commit 43e20d2 into mozilla:main Jun 27, 2022
@willkg
Copy link
Member Author

willkg commented Jun 27, 2022

Thank you!

@willkg willkg added this to the v5.0.1 milestone Jun 27, 2022
@willkg willkg deleted the 668-url-tests branch October 6, 2023 18:57
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.

None yet

2 participants