use super::*;
#[test]
fn test_sanitize_collapses_multiple_newlines() {
let result = sanitize_for_display("Hello\n\nWorld");
assert_eq!(result, "Hello World");
}
#[test]
fn test_sanitize_collapses_multiple_spaces() {
let result = sanitize_for_display("Hello World");
assert_eq!(result, "Hello World");
}
#[test]
fn test_sanitize_mixed_whitespace() {
let result = sanitize_for_display("Hello\n\n \t\t World");
assert_eq!(result, "Hello World");
}
#[test]
fn test_sanitize_trims_leading_trailing_whitespace() {
let result = sanitize_for_display(" Hello World ");
assert_eq!(result, "Hello World");
}
#[test]
fn test_sanitize_only_whitespace() {
let result = sanitize_for_display(" \n\n ");
assert_eq!(result, "");
}
#[test]
fn test_sanitize_preserves_single_spaces() {
let result = sanitize_for_display("Hello World Test");
assert_eq!(result, "Hello World Test");
}
#[test]
fn test_sanitize_does_not_truncate() {
let long_content = "This is a very long string that should NOT be truncated anymore";
let result = sanitize_for_display(long_content);
assert_eq!(result, long_content);
assert!(!result.contains("..."));
}