Skip to main content

command_stream/commands/
true.rs

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