portable-network-archive 0.37.0

Portable-Network-Archive cli
Documentation
//! Smoke tests for completion generation.
//!
//! Completion script contents are generated by `clap_complete` from the clap
//! command graph, so this module intentionally does not duplicate that
//! library's generator assertions. These tests only pin the CLI wiring: each
//! supported shell argument is accepted and completion generation exits
//! successfully.

use assert_cmd::cargo::cargo_bin_cmd;

/// Precondition: None.
/// Action: Run `pna complete bash`.
/// Expectation: Command exits successfully with exit code 0.
#[test]
fn complete_bash_exits_successfully() {
    let mut cmd = cargo_bin_cmd!("pna");
    cmd.args(["complete", "bash"]).assert().success();
}

/// Precondition: None.
/// Action: Run `pna complete zsh`.
/// Expectation: Command exits successfully with exit code 0.
#[test]
fn complete_zsh_exits_successfully() {
    let mut cmd = cargo_bin_cmd!("pna");
    cmd.args(["complete", "zsh"]).assert().success();
}

/// Precondition: None.
/// Action: Run `pna complete fish`.
/// Expectation: Command exits successfully with exit code 0.
#[test]
fn complete_fish_exits_successfully() {
    let mut cmd = cargo_bin_cmd!("pna");
    cmd.args(["complete", "fish"]).assert().success();
}

/// Precondition: None.
/// Action: Run `pna complete powershell`.
/// Expectation: Command exits successfully with exit code 0.
#[test]
fn complete_powershell_exits_successfully() {
    let mut cmd = cargo_bin_cmd!("pna");
    cmd.args(["complete", "powershell"]).assert().success();
}