mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
more: adapt test to change in unicode-width
This commit is contained in:
parent
46d5d638fe
commit
ec67d22123
1 changed files with 3 additions and 3 deletions
|
@ -700,15 +700,15 @@ mod tests {
|
||||||
test_string.push_str("👩🏻🔬");
|
test_string.push_str("👩🏻🔬");
|
||||||
}
|
}
|
||||||
|
|
||||||
let lines = break_line(&test_string, 80);
|
let lines = break_line(&test_string, 31);
|
||||||
|
|
||||||
let widths: Vec<usize> = lines
|
let widths: Vec<usize> = lines
|
||||||
.iter()
|
.iter()
|
||||||
.map(|s| UnicodeWidthStr::width(&s[..]))
|
.map(|s| UnicodeWidthStr::width(&s[..]))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
// Each 👩🏻🔬 is 6 character width it break line to the closest number to 80 => 6 * 13 = 78
|
// Each 👩🏻🔬 is 2 character width, break line to the closest even number to 31
|
||||||
assert_eq!((78, 42), (widths[0], widths[1]));
|
assert_eq!((30, 10), (widths[0], widths[1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue