()
| 997 | |
| 998 | #[test] |
| 999 | fn test_truncate_string_unicode() { |
| 1000 | // Unicode characters should be handled correctly (counting chars, not bytes) |
| 1001 | let result = truncate_string("Hello 世界!", 10); |
| 1002 | // String has 10 chars, so should not be truncated |
| 1003 | assert_eq!(result, "Hello 世界!"); |
| 1004 | |
| 1005 | // Test actual truncation with unicode |
| 1006 | let result2 = truncate_string("Hello 世界!", 8); |
| 1007 | // Should truncate to 5 chars + "..." |
| 1008 | assert!(result2.ends_with("...")); |
| 1009 | assert_eq!(result2.chars().count(), 8); |
| 1010 | } |
| 1011 | |
| 1012 | #[test] |
| 1013 | fn test_format_author_empty_name() { |
nothing calls this directly
no test coverage detected