Skip to content

Commit

Permalink
test: fix parse_message test
Browse files Browse the repository at this point in the history
  • Loading branch information
markhaehnel committed Nov 28, 2023
1 parent 3676875 commit 7074229
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,15 @@ mod tests {
use super::*;

#[test]
fn test_parse_message_some() {
fn test_parse_message() {
let message = paho_mqtt::Message::new(
"device/123456789/report",
r#"{ "hello": "world" }"#,
paho_mqtt::QOS_2,
);

let result = parse_message(Some(message)).unwrap();
let result = parse_message(message).unwrap();

assert_eq!(result, Message::Info(r#"{ "hello": "world" }"#.into()));
}

#[test]
fn test_parse_message_none() {
let result = parse_message(None).unwrap();

assert_eq!(result, Message::Unknown("Unknown message".into()));
}
}

0 comments on commit 7074229

Please sign in to comment.