1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-02 05:57:46 +00:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Tyler 2021-07-12 10:22:20 -07:00
commit 994b4d9a3e
110 changed files with 600 additions and 550 deletions

View file

@ -573,7 +573,8 @@ fn test_du_bytes() {
#[cfg(all(
not(target_vendor = "apple"),
not(target_os = "windows"),
not(target_os = "freebsd")
not(target_os = "freebsd"),
not(target_os = "linux")
))]
result.stdout_contains("21529\t./subdir\n");
}

View file

@ -127,6 +127,15 @@ fn test_squeeze_complement() {
.stdout_is("aaBcDcc");
}
#[test]
fn test_squeeze_complement_two_sets() {
new_ucmd!()
.args(&["-sc", "a", "_"])
.pipe_in("test a aa with 3 ___ spaaaces +++") // spell-checker:disable-line
.run()
.stdout_is("_a_aa_aaa_");
}
#[test]
fn test_translate_and_squeeze() {
new_ucmd!()
@ -275,3 +284,11 @@ fn test_interpret_backslash_at_eol_literally() {
.succeeds()
.stdout_is("\\");
}
#[test]
fn test_more_than_2_sets() {
new_ucmd!()
.args(&["'abcdefgh'", "'a", "'b'"])
.pipe_in("hello world")
.fails();
}

View file

@ -39,7 +39,6 @@ fn test_normal_compare_env() {
let whoami = whoami();
if whoami == "nobody" {
println!("test skipped:");
return;
} else if !is_ci() {
new_ucmd!().succeeds().stdout_is(format!("{}\n", whoami));
} else {

View file

@ -1065,7 +1065,7 @@ pub fn whoami() -> String {
/// Add prefix 'g' for `util_name` if not on linux
#[cfg(unix)]
pub fn host_name_for<'a>(util_name: &'a str) -> Cow<'a, str> {
pub fn host_name_for(util_name: &str) -> Cow<str> {
// In some environments, e.g. macOS/freebsd, the GNU coreutils are prefixed with "g"
// to not interfere with the BSD counterparts already in `$PATH`.
#[cfg(not(target_os = "linux"))]