pub mod color;
pub mod container;
pub mod string;
pub mod style;
pub mod windows;
#[cfg(test)]
mod tests {
use crate::{color::AnsiColor, style::AnsiStyle, string::AnsiString, windows::enable_ansi_support, container::AnsiStyleContainer};
#[test]
fn test_bold() {
let style = vec![AnsiStyle::Bold];
let text = AnsiString::with_styles_vec("world!", style);
println!("Hello, {}", text);
}
#[test]
fn test_colors() {
let style = vec![AnsiStyle::ForegroundColor(AnsiColor::Green)];
let text = AnsiString::with_styles_vec("world!", style);
println!("Hello, {}", text);
}
#[test]
fn test_containers() {
let style = vec![AnsiStyle::ForegroundColor(AnsiColor::Red)];
let container = AnsiStyleContainer::from_vec(style);
let text = container.apply("world!");
println!("Hello, {}", text);
}
#[test]
fn test_windows_enable_ansi_support() {
let result = enable_ansi_support();
assert_eq!(result, Ok(()));
}
}