command_stream/commands/false.rs
1//! Virtual `false` command implementation
2
3use crate::commands::CommandContext;
4use crate::utils::CommandResult;
5
6/// Execute the false command
7///
8/// Always returns failure (exit code 1).
9pub async fn r#false(_ctx: CommandContext) -> CommandResult {
10 CommandResult::error_with_code("", 1)
11}
12
13#[cfg(test)]
14mod tests {
15 use super::*;
16
17 #[tokio::test]
18 async fn test_false() {
19 let ctx = CommandContext::new(vec![]);
20 let result = r#false(ctx).await;
21 assert!(!result.is_success());
22 assert_eq!(result.code, 1);
23 }
24}