From c8a688f44fcbeea82bf559f45d30c48ab5dfd05e Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Fri, 8 May 2026 22:07:55 +0545 Subject: [PATCH] refactor(tests): drop inhibit test file --- tests/inhibit.rs | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 tests/inhibit.rs diff --git a/tests/inhibit.rs b/tests/inhibit.rs deleted file mode 100644 index 3a8bff2..0000000 --- a/tests/inhibit.rs +++ /dev/null @@ -1,45 +0,0 @@ -use clap::Parser; -use lapctl::cli::{Cli, Commands}; - -#[test] -fn test_inhibit_cli_parsing() { - let args = vec!["lapctl", "inhibit", "sleep", "10", "--why", "testing"]; - let cli = Cli::parse_from(args); - - if let Commands::Inhibit { - command, - why, - who, - daemon, - stop: _, - } = cli.command - { - assert_eq!(command, vec!["sleep".to_string(), "10".to_string()]); - assert_eq!(why, "testing"); - assert_eq!(who, "lapctl"); // default value - assert!(!daemon); - } else { - panic!("Command should be Inhibit"); - } -} - -#[test] -fn test_inhibit_daemon_parsing() { - let args = vec!["lapctl", "inhibit", "--daemon"]; - let cli = Cli::parse_from(args); - - if let Commands::Inhibit { - command, - why, - who: _, - daemon, - stop: _, - } = cli.command - { - assert!(command.is_empty()); - assert_eq!(why, "lapctl inhibiting sleep"); // default value - assert!(daemon); - } else { - panic!("Command should be Inhibit"); - } -}