#[cfg(feature = "text-processing")]
#[test]
fn test_text_clean_nfkc_normalization() {
assert_eq!(iscc_lib::text_clean("A"), "A");
}
#[cfg(feature = "text-processing")]
#[test]
fn test_text_clean_removes_control_chars_keeps_newlines() {
assert_eq!(iscc_lib::text_clean("hello\tworld"), "helloworld");
assert_eq!(iscc_lib::text_clean("hello\nworld"), "hello\nworld");
}
#[cfg(feature = "text-processing")]
#[test]
fn test_text_clean_collapses_consecutive_empty_lines() {
assert_eq!(iscc_lib::text_clean("a\n\n\nb"), "a\n\nb");
assert_eq!(iscc_lib::text_clean("a\n\n\n\nb"), "a\n\nb");
}
#[cfg(feature = "text-processing")]
#[test]
fn test_text_clean_crlf_normalization() {
assert_eq!(iscc_lib::text_clean("a\r\nb"), "a\nb");
}
#[cfg(feature = "text-processing")]
#[test]
fn test_text_clean_strips_whitespace() {
assert_eq!(iscc_lib::text_clean(" hello "), "hello");
}
#[cfg(feature = "text-processing")]
#[test]
fn test_text_clean_empty_input() {
assert_eq!(iscc_lib::text_clean(""), "");
}
#[test]
fn test_text_remove_newlines_multiline() {
assert_eq!(
iscc_lib::text_remove_newlines("line one\nline two\nline three"),
"line one line two line three"
);
}
#[test]
fn test_text_remove_newlines_collapses_spaces() {
assert_eq!(iscc_lib::text_remove_newlines("a b c"), "a b c");
}
#[test]
fn test_text_remove_newlines_strips_edges() {
assert_eq!(iscc_lib::text_remove_newlines(" hello "), "hello");
}
#[test]
fn test_text_remove_newlines_empty_input() {
assert_eq!(iscc_lib::text_remove_newlines(""), "");
}
#[test]
fn test_text_trim_shorter_than_limit() {
assert_eq!(iscc_lib::text_trim("hello", 100), "hello");
}
#[test]
fn test_text_trim_exact_length() {
assert_eq!(iscc_lib::text_trim("hello", 5), "hello");
}
#[test]
fn test_text_trim_truncation() {
assert_eq!(iscc_lib::text_trim("hello world", 5), "hello");
}
#[test]
fn test_text_trim_utf8_boundary() {
assert_eq!(iscc_lib::text_trim("é", 1), "");
assert_eq!(iscc_lib::text_trim("café", 4), "caf");
}
#[test]
fn test_text_trim_strips_whitespace() {
assert_eq!(iscc_lib::text_trim("hello ", 6), "hello");
}
#[cfg(feature = "text-processing")]
#[test]
fn test_text_collapse_lowercasing() {
assert_eq!(iscc_lib::text_collapse("HELLO"), "hello");
}
#[cfg(feature = "text-processing")]
#[test]
fn test_text_collapse_whitespace_removal() {
assert_eq!(iscc_lib::text_collapse("a b c"), "abc");
}
#[cfg(feature = "text-processing")]
#[test]
fn test_text_collapse_punctuation_removal() {
assert_eq!(iscc_lib::text_collapse("hello, world!"), "helloworld");
}
#[cfg(feature = "text-processing")]
#[test]
fn test_text_collapse_diacritics_removal() {
assert_eq!(iscc_lib::text_collapse("café"), "cafe");
assert_eq!(iscc_lib::text_collapse("naïve"), "naive");
}
#[cfg(feature = "text-processing")]
#[test]
fn test_text_collapse_empty_input() {
assert_eq!(iscc_lib::text_collapse(""), "");
}
#[test]
fn test_crate_root_imports() {
let _ = iscc_lib::text_remove_newlines("test");
let _ = iscc_lib::text_trim("test", 10);
}
#[cfg(feature = "text-processing")]
#[test]
fn test_crate_root_imports_text_processing() {
let _ = iscc_lib::text_clean("test");
let _ = iscc_lib::text_collapse("test");
}
#[test]
fn test_module_path_imports() {
let _ = iscc_lib::utils::text_remove_newlines("test");
let _ = iscc_lib::utils::text_trim("test", 10);
}
#[cfg(feature = "text-processing")]
#[test]
fn test_module_path_imports_text_processing() {
let _ = iscc_lib::utils::text_clean("test");
let _ = iscc_lib::utils::text_collapse("test");
}