Skip to content

Commit e88ee72

Browse files
committed
Add test for new StdAck From impl
1 parent 6a8053e commit e88ee72

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/std/src/stdack.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,13 @@ mod tests {
166166
let ack2 = StdAck::error("kaputt");
167167
assert_eq!(ack2.to_binary(), br#"{"error":"kaputt"}"#);
168168
}
169+
170+
#[test]
171+
fn stdack_to_option_binary_works() {
172+
let ack1 = StdAck::success(b"\x01");
173+
assert_eq!(Option::<Binary>::from(ack1.clone()), Some(ack1.to_binary()));
174+
175+
let ack2 = StdAck::error("kaputt");
176+
assert_eq!(Option::<Binary>::from(ack2.clone()), Some(ack2.to_binary()));
177+
}
169178
}

0 commit comments

Comments
 (0)