zilliz 1.4.3

TUI and CLI tool for managing Zilliz Cloud clusters and Milvus operations
Documentation
use zilliz::cli::quickstart::is_interactive;

const QUICKSTART_SRC: &str = include_str!("../src/cli/quickstart.rs");

#[test]
fn cheatsheet_uses_only_placeholders() {
    // The cheatsheet must never substitute real org/instance IDs — every
    // identifier must be a generic placeholder so the printed commands
    // are safe to copy into a doc or share verbatim.
    let src = QUICKSTART_SRC;

    let start = src
        .find("fn print_cheatsheet")
        .expect("print_cheatsheet defined");
    let end = src[start..]
        .find("// Helpers")
        .expect("cheatsheet ends before Helpers section")
        + start;
    let body = &src[start..end];

    assert!(
        body.contains("<clusterId>"),
        "expected <clusterId> placeholder"
    );
    assert!(body.contains("<orgId>"), "expected <orgId> placeholder");
    assert!(
        !body.contains("in01-") && !body.contains("in05-"),
        "cheatsheet must not contain real cluster ID prefixes (in01-/in05-)"
    );
    assert!(
        !body.contains("org-"),
        "cheatsheet must not contain real org ID prefix (org-)"
    );
}

#[test]
fn non_interactive_when_flag_set() {
    assert!(!is_interactive(true));
}

#[test]
fn cheatsheet_contains_required_sections() {
    let src = QUICKSTART_SRC;
    for header in [
        "Authentication:",
        "Context:",
        "Clusters:",
        "Collections & Vectors:",
        "Output formatting:",
        "Help:",
    ] {
        assert!(
            src.contains(header),
            "cheatsheet missing section header: {}",
            header
        );
    }
}