Skip to content

Commit

Permalink
add a test for the esc_status submessage
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Etter committed Mar 3, 2020
1 parent 18802b3 commit 5ea526c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/full_parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,21 @@ mod tests {
let filename = format!("{}/tests/fixtures/sample.ulg", env!("CARGO_MANIFEST_DIR"));
read_file(&filename).unwrap();
}

#[test]
fn reads_repeated_submessage() {
let filename = format!(
"{}/tests/fixtures/esc_status_log.ulg",
env!("CARGO_MANIFEST_DIR")
);
let parsed_data = read_file(&filename).unwrap();
let msg = parsed_data
.messages
.get("esc_status")
.unwrap()
.get(&MultiId::new(0))
.unwrap();

assert!(msg.contains_key("esc[5].esc_rpm"));
}
}
Binary file added tests/fixtures/esc_status_log.ulg
Binary file not shown.

0 comments on commit 5ea526c

Please sign in to comment.