Skip to content

Commit

Permalink
chore: simplify test using matches!
Browse files Browse the repository at this point in the history
  • Loading branch information
keroro520 committed Dec 24, 2024
1 parent 881bac4 commit 0640e52
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions crates/sdk/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,11 @@ fn test_public_values_and_leaf_verification() {
public_values_root_proof: Some(wrong_pv_root_proof),
},
);
match execution_result.err().unwrap() {
ExecutionError::Fail { .. } => {}
_ => {
panic!("Expected failure: the public value root proof has a wrong pv commit")
}
}
assert!(
matches!(execution_result, Err(ExecutionError::Fail { .. })),
"Expected failure: the public value root proof has a wrong pv commit: {:?}",
execution_result
);
}

// Failure: The public value root proof has a wrong path proof.
Expand All @@ -245,10 +244,11 @@ fn test_public_values_and_leaf_verification() {
public_values_root_proof: Some(wrong_pv_root_proof),
},
);
match execution_result.err().unwrap() {
ExecutionError::Fail { .. } => {}
_ => panic!("Expected failure: the public value root proof has a wrong path proof"),
}
assert!(
matches!(execution_result, Err(ExecutionError::Fail { .. })),
"Expected failure: the public value root proof has a wrong path proof: {:?}",
execution_result
);
}
}

Expand Down

0 comments on commit 0640e52

Please sign in to comment.