fix: master log parse (invalid station detection in status parse)

- missed switch for `Station1`
- added integrated test to check lines count of output csv
This commit is contained in:
Wataru Otsubo 2024-07-23 22:38:22 +09:00
parent e20c029684
commit fb5160d2d9
2 changed files with 30 additions and 21 deletions

View file

@ -7,6 +7,7 @@ mod integrated_test {
use anyhow::Result;
use assert_cmd::Command;
use itertools::Itertools;
use predicates::prelude::*;
#[test]
@ -26,17 +27,21 @@ mod integrated_test {
// check output
{
// check output content
let f = File::open(test_out.clone())?;
let r = BufReader::new(f);
assert!(r
.lines()
.any(|line| {
line
.unwrap()
.contains(
"8866,,B-0-1,0,1,1,0,1,8,1,,7,2024-07-20T17:15:46Z,7.log,0.1.0,alice,,,,"
)
}));
assert!(r.lines().any(|line| {
line.unwrap().contains(
"8866,,B-0-1,0,1,1,0,1,8,1,,7,2024-07-20T17:15:46Z,7.log,0.1.0,alice,,,,",
)
}));
}
{
// Check output lines count
let f = File::open(test_out.clone())?;
let r = BufReader::new(f);
let lc = r.lines().collect_vec().len();
assert_eq!(lc, 19);
}
// 2nd file