Skip to content
Snippets Groups Projects
Verified Commit 5447da4f authored by Yaroslav Dynnikov's avatar Yaroslav Dynnikov
Browse files

test: mailbox

parent 5f54c7b9
No related branches found
No related tags found
1 merge request!84test: mailbox
Pipeline #4382 passed
...@@ -39,3 +39,20 @@ impl<T> Mailbox<T> { ...@@ -39,3 +39,20 @@ impl<T> Mailbox<T> {
self.0.content.take() self.0.content.take()
} }
} }
inventory::submit!(crate::InnerTest {
name: "test_mailbox",
body: || {
let mailbox = Mailbox::<u8>::new();
assert_eq!(mailbox.receive_all(Duration::ZERO), Vec::<u8>::new());
mailbox.send(1);
assert_eq!(mailbox.receive_all(Duration::ZERO), vec![1]);
mailbox.send(2);
mailbox.send(3);
assert_eq!(mailbox.receive_all(Duration::ZERO), vec![2, 3]);
assert_eq!(format!("{mailbox:?}"), "Mailbox<u8> { .. }")
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment