xacli_testing/
lib.rs

1//! Testing utilities for XaCLI framework
2//!
3//! This crate provides tools for testing CLI applications and interactive components
4//! built with XaCLI. It includes:
5//!
6//! - **Event Builder**: Programmatically create keyboard events
7//! - **VHS Tape Parser**: Parse VHS `.tape` files for test automation
8//! - **Output Capture**: Capture and assert terminal output
9//! - **Test Builders**: Helper functions from xacli-core testing
10
11pub mod builders;
12pub mod events;
13pub mod output;
14pub mod tape;
15
16pub use builders::*;
17pub use events::*;
18pub use output::*;
19pub use tape::{events_from_tape, TapeInstruction, TapeParser};
20
21/// Prelude module for convenient imports
22pub mod prelude {
23    pub use crate::{
24        builders::*,
25        events::*,
26        output::*,
27        tape::{events_from_tape, TapeInstruction, TapeParser},
28    };
29}
30
31/// Error types for xacli-testing
32#[derive(Debug, thiserror::Error)]
33pub enum TestingError {
34    #[error("IO error: {0}")]
35    Io(#[from] std::io::Error),
36
37    #[error("Tape parse error: {0}")]
38    TapeParse(String),
39
40    #[error("Channel error: {0}")]
41    Channel(String),
42}
43
44pub type Result<T> = std::result::Result<T, TestingError>;