Skip to content

Commit

Permalink
Add test for new StdAck From impl
Browse files Browse the repository at this point in the history
  • Loading branch information
chipshort committed Dec 13, 2023
1 parent 6a8053e commit e88ee72
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/std/src/stdack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,13 @@ mod tests {
let ack2 = StdAck::error("kaputt");
assert_eq!(ack2.to_binary(), br#"{"error":"kaputt"}"#);
}

#[test]
fn stdack_to_option_binary_works() {
let ack1 = StdAck::success(b"\x01");
assert_eq!(Option::<Binary>::from(ack1.clone()), Some(ack1.to_binary()));

let ack2 = StdAck::error("kaputt");
assert_eq!(Option::<Binary>::from(ack2.clone()), Some(ack2.to_binary()));
}
}

0 comments on commit e88ee72

Please sign in to comment.