tftio-lib 0.1.0

Shared CLI, agent-mode, and prompt-handling library for tftio Rust tools
Documentation
//! Public API integration tests for `tftio-lib`.

use tftio_lib::{AgentModeContext, DoctorCheck, RepoInfo, prompt};

#[test]
fn cli_common_surface_is_available_at_the_crate_root() {
    let repository = RepoInfo::new("tftorium", "example");
    let check = DoctorCheck::pass("configuration");
    let agent = AgentModeContext::from_tokens(Some("token".into()), Some("token".into()));

    assert_eq!(repository.owner, "tftorium");
    assert_eq!(repository.name, "example");
    assert!(check.passed);
    assert!(agent.active);
}

#[test]
fn prompt_surface_is_available_under_its_namespace() {
    let family = prompt::FamilyName::new("gpt");

    assert_eq!(family.as_ref().map(prompt::FamilyName::as_str), Ok("gpt"));
    assert_eq!(prompt::unescape("one\\ntwo"), "one\ntwo");
    assert!(prompt::FamilyName::new("../gpt").is_err());
}