1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-16 03:36:18 +00:00

Merge pull request #3429 from cakebaker/ticket_3425

df: fix "File" column width for unicode filenames
This commit is contained in:
Sylvestre Ledru 2022-04-20 10:50:07 +02:00 committed by GitHub
commit f6dafbc950
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 2 deletions

View file

@ -165,6 +165,7 @@ fn test_output_mp_repeat() {
assert_eq!(3, output1.len());
assert_eq!(output1[1], output1[2]);
}
#[test]
fn test_output_conflict_options() {
for option in ["-i", "-T", "-P"] {
@ -430,6 +431,20 @@ fn test_output_file_specific_files() {
assert_eq!(actual, vec!["File", "a ", "b ", "c "]);
}
#[test]
fn test_file_column_width_if_filename_contains_unicode_chars() {
let (at, mut ucmd) = at_and_ucmd!();
at.touch("äöü.txt");
let output = ucmd
.args(&["--output=file,target", "äöü.txt"])
.succeeds()
.stdout_move_str();
let actual = output.lines().next().unwrap();
// expected width: 7 chars (length of äöü.txt) + 1 char (column separator)
assert_eq!(actual, "File Mounted on");
}
#[test]
fn test_output_field_no_more_than_once() {
new_ucmd!()