about summary refs log tree commit diff
path: root/src/tests.rs
blob: 0018e40dacd3511cd42e7d9d57000161025746ef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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();
}