mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
address review comments
This commit is contained in:
parent
268b180416
commit
e071286eb0
3 changed files with 3 additions and 18 deletions
|
@ -289,7 +289,6 @@ indicatif = "0.17"
|
||||||
itertools = "0.12.0"
|
itertools = "0.12.0"
|
||||||
libc = "0.2.150"
|
libc = "0.2.150"
|
||||||
lscolors = { version = "0.16.0", default-features = false, features = [
|
lscolors = { version = "0.16.0", default-features = false, features = [
|
||||||
"nu-ansi-term",
|
|
||||||
"gnu_legacy",
|
"gnu_legacy",
|
||||||
] }
|
] }
|
||||||
memchr = "2"
|
memchr = "2"
|
||||||
|
|
|
@ -22,7 +22,7 @@ number_prefix = { workspace = true }
|
||||||
uutils_term_grid = { workspace = true }
|
uutils_term_grid = { workspace = true }
|
||||||
terminal_size = { workspace = true }
|
terminal_size = { workspace = true }
|
||||||
glob = { workspace = true }
|
glob = { workspace = true }
|
||||||
lscolors = { workspace = true, features = ["gnu_legacy"] }
|
lscolors = { workspace = true }
|
||||||
uucore = { workspace = true, features = [
|
uucore = { workspace = true, features = [
|
||||||
"entries",
|
"entries",
|
||||||
"fs",
|
"fs",
|
||||||
|
|
|
@ -1983,20 +1983,6 @@ fn test_ls_recursive_1() {
|
||||||
.stdout_is(out);
|
.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]
|
#[test]
|
||||||
fn test_ls_color() {
|
fn test_ls_color() {
|
||||||
let scene = TestScenario::new(util_name!());
|
let scene = TestScenario::new(util_name!());
|
||||||
|
@ -2058,8 +2044,8 @@ fn test_ls_color() {
|
||||||
.succeeds();
|
.succeeds();
|
||||||
let expected = format!("{} test-color\x0ab {}", a_with_colors, z_with_colors);
|
let expected = format!("{} test-color\x0ab {}", a_with_colors, z_with_colors);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
to_ascii_representation(result.stdout_str()),
|
result.stdout_str().escape_default().to_string(),
|
||||||
to_ascii_representation(&expected)
|
expected.escape_default().to_string()
|
||||||
);
|
);
|
||||||
assert_eq!(result.stdout_str(), expected);
|
assert_eq!(result.stdout_str(), expected);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue