Skip to content

Conversation

@caspermeijn
Copy link
Contributor

Add a fuzzing target for parsing into a Duration.

@caspermeijn
Copy link
Contributor Author

@mumbleskates This is the other fuzzer I used for my testing. Do you have suggestions?

Copy link
Contributor

@mumbleskates mumbleskates left a comment

Choose a reason for hiding this comment

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

this looks pretty good. in the fuzzer i have committed so far i also added some regex that helps assert that anything we successfully parsed actually looks reasonable and like we expect, so we don't end up accidentally parsing something that looks really strange. for this case that should be a super simple pattern.

Add a fuzzing target for parsing into a Duration.
@caspermeijn
Copy link
Contributor Author

this looks pretty good. in the fuzzer i have committed so far i also added some regex that helps assert that anything we successfully parsed actually looks reasonable and like we expect, so we don't end up accidentally parsing something that looks really strange. for this case that should be a super simple pattern.

I found that the regex made the test less readable. If we can roundtrip the text, then it can't be that strange, right?

@caspermeijn caspermeijn added this pull request to the merge queue Aug 23, 2024
Merged via the queue into tokio-rs:master with commit 0c79864 Aug 23, 2024
@caspermeijn caspermeijn deleted the fuzz_duration branch August 23, 2024 09:15
@mumbleskates
Copy link
Contributor

that is a reasonable enough logic! i find regex pretty tractable personally but that obviously varies wildly from person to person. works great without 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

Successfully merging this pull request may close these issues.

2 participants