Watch
0
0
Fork
You've already forked hyperhive
0

hive-forge: inline test Args literals, drop the 4-bool helper (clippy::fn_params_excessive_bools)

This commit is contained in:
damocles 2026-10-09 12:10:48 +02:00 • committed by mara
commit 7b4ef40688

View file

@ -128,19 +128,15 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
mod tests {
use super::{Args, reject_ignore};
fn args(watch: bool, ignore: bool, unwatch: bool, list: bool) -> Args {
Args {
watch,
ignore,
unwatch,
list,
}
}
#[test]
fn ignore_is_rejected_pointing_at_unwatch() {
let err =
reject_ignore(&args(false, true, false, false)).expect_err("--ignore must be refused");
let args = Args {
watch: false,
ignore: true,
unwatch: false,
list: false,
};
let err = reject_ignore(&args).expect_err("--ignore must be refused");
let msg = err.to_string();
assert!(msg.contains("--unwatch"));
assert!(msg.contains("--watch"));
@ -149,6 +145,12 @@ mod tests {
#[test]
fn watch_is_not_rejected() {
assert!(reject_ignore(&args(true, false, false, false)).is_ok());
let args = Args {
watch: true,
ignore: false,
unwatch: false,
list: false,
};
assert!(reject_ignore(&args).is_ok());
}
}