Skip to content

Commit bad8119

Browse files
authored
chore: respect char boundaries in node_compat test output truncation (#32658)
1 parent 9d246e7 commit bad8119

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/node_compat/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ fn parse_flags(source: &str) -> (Vec<String>, Vec<String>) {
507507

508508
fn truncate_output(output: &str, max_len: usize) -> String {
509509
if output.len() > max_len {
510-
format!("{} ...", &output[..max_len])
510+
format!("{} ...", &output[..output.floor_char_boundary(max_len)])
511511
} else {
512512
output.to_string()
513513
}

0 commit comments

Comments
 (0)