Skip to content

Commit

Permalink
test: update
Browse files Browse the repository at this point in the history
Signed-off-by: blob42 <contact@blob42.xyz>
  • Loading branch information
blob42 committed Oct 2, 2024
1 parent 2db256b commit 589ef48
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,29 @@ mod tests {
condition = {seen = "10s"}
exec = ["echo", "still there"]
###
[[profiles]]
matching = { name = "foo_not_seen" }
[[profiles.commands]]
condition = {not_seen = "5s"}
exec = ["echo", "not seen"]
###
[[profiles]]
matching = { exe_path = "b.n.*sh", regex = true }
[[profiles.commands]]
condition = {not_seen = "5s"}
exec = ["echo", "not seen"]
"###};

let c = parse_config(config)?;
assert_eq!(c.profiles.len(), 2);
assert_eq!(c.profiles[0].commands.len(), 2);
assert_eq!(c.profiles.len(), 3, "non matching number of declared profiles");
assert_eq!(c.profiles[0].commands.len(), 2, "non matching number of commands on profile1");
Ok(())
}
}

0 comments on commit 589ef48

Please sign in to comment.