use super::*;
#[test]
fn bare_mcp_parses_to_serve_mode() {
let cli = crate::Cli::try_parse_from(["newt", "mcp"]).unwrap();
assert!(
matches!(cli.command, Some(crate::Command::Mcp { cmd: None })),
"bare `newt mcp` must keep serving over stdio"
);
}
#[test]
fn mcp_serve_parses_to_serve_variant() {
let cli = crate::Cli::try_parse_from(["newt", "mcp", "serve"]).unwrap();
assert!(
matches!(
cli.command,
Some(crate::Command::Mcp {
cmd: Some(McpCmd::Serve)
})
),
"`newt mcp serve` must parse to the Serve variant"
);
}
#[test]
fn bare_mcp_action_serves_when_stdin_is_piped() {
assert_eq!(bare_mcp_action(false), BareMcpAction::Serve);
}
#[test]
fn bare_mcp_action_prints_help_when_stdin_is_a_terminal() {
assert_eq!(bare_mcp_action(true), BareMcpAction::Help);
}