use proptest::prelude::*;
use ricecoder_cli::output::OutputStyle;
#[test]
fn prop_output_formatting_idempotence() {
proptest!(|(msg in ".*")| {
let style = OutputStyle { use_colors: false };
let formatted1 = style.success(&msg);
let formatted2 = style.success(&msg);
prop_assert_eq!(formatted1, formatted2);
});
}
#[test]
fn test_formatting_without_colors_deterministic() {
let style = OutputStyle { use_colors: false };
let msg = "test message";
let formatted1 = style.success(msg);
let formatted2 = style.success(msg);
let formatted3 = style.success(msg);
assert_eq!(formatted1, formatted2);
assert_eq!(formatted2, formatted3);
}
#[test]
fn test_all_formatting_methods_idempotent() {
let style = OutputStyle { use_colors: false };
let msg = "test";
assert_eq!(style.success(msg), style.success(msg));
assert_eq!(style.error(msg), style.error(msg));
assert_eq!(style.warning(msg), style.warning(msg));
assert_eq!(style.info(msg), style.info(msg));
assert_eq!(style.code(msg), style.code(msg));
assert_eq!(style.prompt(msg), style.prompt(msg));
assert_eq!(style.header(msg), style.header(msg));
}
#[test]
fn test_formatting_output_structure() {
let style = OutputStyle { use_colors: false };
assert!(style.success("test").starts_with("✓"));
assert!(style.error("test").starts_with("✗"));
assert!(style.warning("test").starts_with("⚠"));
assert!(style.info("test").starts_with("ℹ"));
}