()
| 985 | |
| 986 | #[test] |
| 987 | fn test_truncate_string_unicode() { |
| 988 | // Unicode characters should be handled correctly (counting chars, not bytes) |
| 989 | let result = truncate_string("Hello 世界!", 10); |
| 990 | // String has 10 chars, so should not be truncated |
| 991 | assert_eq!(result, "Hello 世界!"); |
| 992 | |
| 993 | // Test actual truncation with unicode |
| 994 | let result2 = truncate_string("Hello 世界!", 8); |
| 995 | // Should truncate to 5 chars + "..." |
| 996 | assert!(result2.ends_with("...")); |
| 997 | assert_eq!(result2.chars().count(), 8); |
| 998 | } |
| 999 | |
| 1000 | #[test] |
| 1001 | fn test_format_author_empty_name() { |
nothing calls this directly
no test coverage detected