-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: Closer to pretty display error info
- Loading branch information
1 parent
1d0e670
commit 8299a16
Showing
4 changed files
with
436 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#![no_main] | ||
|
||
use keyvalues_parser::Vdf; | ||
use libfuzzer_sys::fuzz_target; | ||
|
||
fuzz_target!(|text: &str| { | ||
if let Err(err) = Vdf::parse(text) { | ||
// Lots of fiddly logic in displaying that can panic | ||
err.to_string(); | ||
|
||
// The error snippet should match the original text sliced using the error span | ||
let from_orig = err.index_span().slice(text); | ||
let from_snippet = err.error_snippet(); | ||
assert_eq!(from_orig, from_snippet); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.