Skip to content

Commit

Permalink
fix: disable prettydiff output which will seg fault (#8)
Browse files Browse the repository at this point in the history
Signed-off-by: Ruihang Xia <[email protected]>
  • Loading branch information
waynexia committed Dec 27, 2022
1 parent e96b85f commit 6208dc0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description = "SQL integration test harness"
[dependencies]
async-trait = "0.1"
derive_builder = "0.11"
prettydiff = { version = "0.6", features = ["prettytable-rs"] }
prettydiff = "0.6"
serde = { version = "1.0", features = ["derive"] }
thiserror = "1.0"
tokio = { version = "1.21", features = ["full"] }
Expand Down
12 changes: 10 additions & 2 deletions src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,16 @@ impl<E: Environment> Runner<E> {
.names("Expected", "Actual");
let is_different = diff.diff().iter().any(|d| !matches!(d, DiffOp::Equal(_)));
if is_different {
println!("Result unexpected, path:{:?}\n", path.as_ref());
diff.prettytable();
println!("Result unexpected, path:{:?}", path.as_ref());
println!(
"Hint: compare them with \"diff {} {}\"\n",
path.as_ref()
.with_extension(&self.config.output_result_extension)
.display(),
path.as_ref()
.with_extension(&self.config.expect_result_extension)
.display()
)
}

Ok(is_different)
Expand Down

0 comments on commit 6208dc0

Please sign in to comment.