Skip to content

Commit

Permalink
Simplify aggregator state machines match in tests
Browse files Browse the repository at this point in the history
Since they don't use the structure content it can be fully eluded.
  • Loading branch information
Alenar committed Mar 27, 2024
1 parent 28206ea commit 28afe5d
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions mithril-aggregator/src/runtime/state_machine.rs
Expand Up @@ -472,13 +472,7 @@ mod tests {
)
.await;
let err = runtime.cycle().await.unwrap_err();
assert!(matches!(
err,
RuntimeError::KeepState {
message: _,
nested_error: _
}
));
assert!(matches!(err, RuntimeError::KeepState { .. }));

assert_eq!("idle".to_string(), runtime.get_state());
}
Expand Down Expand Up @@ -695,10 +689,7 @@ mod tests {
.expect_err("cycle should have returned an error");

match err {
RuntimeError::KeepState {
message: _,
nested_error: _,
} => (),
RuntimeError::KeepState { .. } => (),
_ => panic!("KeepState error expected, got {err:?}."),
};

Expand Down Expand Up @@ -738,10 +729,7 @@ mod tests {
.expect_err("cycle should have returned an error");

match err {
RuntimeError::ReInit {
message: _,
nested_error: _,
} => (),
RuntimeError::ReInit { .. } => (),
_ => panic!("ReInit error expected, got {err:?}."),
};

Expand Down

0 comments on commit 28afe5d

Please sign in to comment.