Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvestre committed Dec 9, 2023
1 parent a7f2c32 commit 5507e1b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ indicatif = "0.17"
itertools = "0.12.0"
libc = "0.2.150"
lscolors = { version = "0.16.0", default-features = false, features = [
"nu-ansi-term",
"gnu_legacy",
] }
memchr = "2"
Expand Down
2 changes: 1 addition & 1 deletion src/uu/ls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ number_prefix = { workspace = true }
uutils_term_grid = { workspace = true }
terminal_size = { workspace = true }
glob = { workspace = true }
lscolors = { workspace = true, features = ["gnu_legacy"] }
lscolors = { workspace = true }
uucore = { workspace = true, features = [
"entries",
"fs",
Expand Down
18 changes: 2 additions & 16 deletions tests/by-util/test_ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1983,20 +1983,6 @@ fn test_ls_recursive_1() {
.stdout_is(out);
}

// Function to convert a string to its ASCII representation
fn to_ascii_representation(input: &str) -> String {
input
.chars()
.map(|c| {
if c.is_ascii_control() || !c.is_ascii() {
format!("\\x{:02x}", c as u32)
} else {
c.to_string()
}
})
.collect::<String>()
}

#[test]
fn test_ls_color() {
let scene = TestScenario::new(util_name!());
Expand Down Expand Up @@ -2058,8 +2044,8 @@ fn test_ls_color() {
.succeeds();
let expected = format!("{} test-color\x0ab {}", a_with_colors, z_with_colors);
assert_eq!(
to_ascii_representation(result.stdout_str()),
to_ascii_representation(&expected)
result.stdout_str().escape_default().to_string(),
expected.escape_default().to_string()
);
assert_eq!(result.stdout_str(), expected);
}
Expand Down

0 comments on commit 5507e1b

Please sign in to comment.