0b146dc079
First bump since 2017! This changes the code to be compatible with newer versions of the `nix` crate, which has shuffled things around a bit.
22 lines
555 B
Rust
22 lines
555 B
Rust
use super::*;
|
|
|
|
#[test]
|
|
fn test_open_delete() {
|
|
// Simple test with default queue settings
|
|
let name = Name::new("/test-queue").unwrap();
|
|
let queue = Queue::open_or_create(name)
|
|
.expect("Opening queue failed");
|
|
|
|
let message = Message {
|
|
data: "test-message".as_bytes().to_vec(),
|
|
priority: 0,
|
|
};
|
|
|
|
queue.send(&message).expect("message sending failed");
|
|
|
|
let result = queue.receive().expect("message receiving failed");
|
|
|
|
assert_eq!(message, result);
|
|
|
|
queue.delete().expect("deleting queue failed");
|
|
}
|