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 failing test for quadbez panic and add fix. #316

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

richard-uk1
Copy link
Collaborator

Before this PR, the ParamCurveNearest::nearest method can panic for QuadBez with certain input. This PR adds a test to avoid the panic.

Closes #315

Before this PR, the `ParamCurveNearest::nearest` method can panic for
`QuadBez` with certain input. This PR adds a test to avoid the panic.
@richard-uk1
Copy link
Collaborator Author

I ran the changed code through the proptest branch with 100_000_000 random floats and didn't hit any panics.

Copy link
Contributor

@raphlinus raphlinus left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@@ -1,3 +1,5 @@
.vscode
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this intentional? I think it's ok but am wondering if it accidentally got picked up.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was seeing it in my git status and thought I'd add it to .gitignore so that I don't accidentally include it with git add -A which I use from time to time. I don't think we'll want to include vscode stuff in kurbo in the future but if we do we can always remove it from .gitignore :)

@richard-uk1 richard-uk1 merged commit c7cb529 into main Oct 12, 2023
14 checks passed
@richard-uk1 richard-uk1 deleted the quadbez_nearest_panic branch October 12, 2023 14:57
@richard-uk1 richard-uk1 restored the quadbez_nearest_panic branch October 12, 2023 14: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.

<QuadBez as ParamCurveNearest>::nearest can panic
2 participants