Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
correct diff args
Browse files Browse the repository at this point in the history
  • Loading branch information
addisoncrump committed Jun 12, 2023
1 parent fdbaafa commit 4078243
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions fuzz/fuzz_targets/rome_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ pub fn fuzz_js_formatter_with_source_type(data: &[u8], source: JsFileSource) ->
);
if let Some(diagnostic) = maybe_diagnostic {
panic!(
"formatter introduced linter failure: {}\n{}",
"formatter introduced linter failure: {} (expected one of: {})\n{}",
diagnostic,
linter_errors.join(", "),
TextDiff::from_lines(code1, code2)
.unified_diff()
.header("original code", "formatted")
Expand All @@ -142,11 +143,12 @@ pub fn fuzz_js_formatter_with_source_type(data: &[u8], source: JsFileSource) ->
let printed2 = formatted2
.print()
.expect("reformatted code could not be printed");
let code3 = printed2.as_code();
assert_eq!(
code2,
printed2.as_code(),
code3,
"format results differ:\n{}",
TextDiff::from_lines(code1, code2)
TextDiff::from_lines(code2, code3)
.unified_diff()
.header("formatted", "reformatted")
)
Expand Down

0 comments on commit 4078243

Please sign in to comment.