MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_truncate_string_unicode

Function test_truncate_string_unicode

atomic-cli/src/commands/log/tests.rs:999–1010  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 1

truncate_stringFunction · 0.70

Tested by

no test coverage detected