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

test: fuzz mdx parser #25

Merged
merged 3 commits into from
Nov 25, 2022
Merged

test: fuzz mdx parser #25

merged 3 commits into from
Nov 25, 2022

Conversation

ChristianMurphy
Copy link
Collaborator

This adds .ok() to the Result to capture and ignore recoverable errors.

@ChristianMurphy
Copy link
Collaborator Author

This may want to wait on #26, currently panic! gets triggered pretty quickly

fuzz/fuzz_targets/markdown.rs Outdated Show resolved Hide resolved
let _ = markdown::to_mdast(s, &markdown::ParseOptions::default());
let _ = markdown::to_mdast(s, &markdown::ParseOptions::gfm());
let _ = markdown::to_mdast(s, &markdown::ParseOptions::mdx()).ok();
Copy link
Owner

Choose a reason for hiding this comment

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

What does the .ok() add? I believe it’ll work fine without it: that it’s a result and doesn’t panic?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My impression is/was that some errors are to be expected with MDX?
My goal is to capture/ignore known errors, and only look for unexpected panic!.

That understand could be incorrect though.
Is the goal with the mdx parser to never throw?


in the meantime removed .ok

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

also related #26 (comment)

@wooorm wooorm merged commit 7f06d55 into main Nov 25, 2022
@wooorm wooorm deleted the test/fuzz-mdx-parser branch November 25, 2022 11:09
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