diff --git a/src/uu/dd/src/parseargs.rs b/src/uu/dd/src/parseargs.rs index 081055cf9..d8639fca9 100644 --- a/src/uu/dd/src/parseargs.rs +++ b/src/uu/dd/src/parseargs.rs @@ -807,15 +807,16 @@ mod tests { #[test] fn test_parse_bytes_with_opt_multiplier() { assert_eq!(parse_bytes_with_opt_multiplier("123").unwrap(), 123); - assert_eq!(parse_bytes_with_opt_multiplier("123c").unwrap(), 123 * 1); + assert_eq!(parse_bytes_with_opt_multiplier("123c").unwrap(), 123); // 123 * 1 assert_eq!(parse_bytes_with_opt_multiplier("123w").unwrap(), 123 * 2); assert_eq!(parse_bytes_with_opt_multiplier("123b").unwrap(), 123 * 512); assert_eq!(parse_bytes_with_opt_multiplier("123x3").unwrap(), 123 * 3); assert_eq!(parse_bytes_with_opt_multiplier("123k").unwrap(), 123 * 1024); - assert_eq!(parse_bytes_with_opt_multiplier("1x2x3").unwrap(), 1 * 2 * 3); + assert_eq!(parse_bytes_with_opt_multiplier("1x2x3").unwrap(), 6); // 1 * 2 * 3 + assert_eq!( parse_bytes_with_opt_multiplier("1wx2cx3w").unwrap(), - (1 * 2) * (2 * 1) * (3 * 2) + 2 * 2 * (3 * 2) // (1 * 2) * (2 * 1) * (3 * 2) ); assert!(parse_bytes_with_opt_multiplier("123asdf").is_err()); } diff --git a/src/uu/df/src/table.rs b/src/uu/df/src/table.rs index 65d390dd2..c8ac4989e 100644 --- a/src/uu/df/src/table.rs +++ b/src/uu/df/src/table.rs @@ -577,7 +577,7 @@ mod tests { inodes_usage: Some(0.2), }; assert_eq!( - DisplayRow::new(row, &options).to_string(), + DisplayRow::new(&row, &options).to_string(), "my_device 100 25 75 26% my_mount " ); } diff --git a/src/uu/split/src/number.rs b/src/uu/split/src/number.rs index d5427e2ca..c7557271d 100644 --- a/src/uu/split/src/number.rs +++ b/src/uu/split/src/number.rs @@ -479,7 +479,7 @@ mod tests { fn num(n: usize) -> Number { let mut number = Number::DynamicWidth(DynamicWidthNumber::new(16)); for _ in 0..n { - number.increment().unwrap() + number.increment().unwrap(); } number } diff --git a/tests/by-util/test_sort.rs b/tests/by-util/test_sort.rs index 5ae56b29e..c33d1a986 100644 --- a/tests/by-util/test_sort.rs +++ b/tests/by-util/test_sort.rs @@ -338,24 +338,20 @@ fn test_dictionary_order() { #[test] fn test_dictionary_order2() { - for non_dictionary_order2_param in &["-d"] { - new_ucmd!() - .pipe_in("a👦🏻aa\tb\naaaa\tb") // spell-checker:disable-line - .arg(non_dictionary_order2_param) // spell-checker:disable-line - .succeeds() - .stdout_only("a👦🏻aa\tb\naaaa\tb\n"); // spell-checker:disable-line - } + new_ucmd!() + .pipe_in("a👦🏻aa\tb\naaaa\tb") // spell-checker:disable-line + .arg("-d") + .succeeds() + .stdout_only("a👦🏻aa\tb\naaaa\tb\n"); // spell-checker:disable-line } #[test] fn test_non_printing_chars() { - for non_printing_chars_param in &["-i"] { - new_ucmd!() - .pipe_in("a👦🏻aa\naaaa") // spell-checker:disable-line - .arg(non_printing_chars_param) // spell-checker:disable-line - .succeeds() - .stdout_only("a👦🏻aa\naaaa\n"); // spell-checker:disable-line - } + new_ucmd!() + .pipe_in("a👦🏻aa\naaaa") // spell-checker:disable-line + .arg("-i") + .succeeds() + .stdout_only("a👦🏻aa\naaaa\n"); // spell-checker:disable-line } #[test] @@ -486,14 +482,12 @@ fn test_default_unsorted_ints2() { #[test] fn test_numeric_unique_ints2() { - for numeric_unique_sort_param in &["-nu"] { - let input = "9\n9\n8\n1\n"; - new_ucmd!() - .arg(numeric_unique_sort_param) - .pipe_in(input) - .succeeds() - .stdout_only("1\n8\n9\n"); - } + let input = "9\n9\n8\n1\n"; + new_ucmd!() + .arg("-nu") + .pipe_in(input) + .succeeds() + .stdout_only("1\n8\n9\n"); } #[test] diff --git a/tests/by-util/test_who.rs b/tests/by-util/test_who.rs index 8c3bba25c..2687539f1 100644 --- a/tests/by-util/test_who.rs +++ b/tests/by-util/test_who.rs @@ -69,10 +69,8 @@ fn test_login() { #[test] fn test_m() { let ts = TestScenario::new(util_name!()); - for opt in &["-m"] { - let expected_stdout = unwrap_or_return!(expected_result(&ts, &[opt])).stdout_move_str(); - ts.ucmd().arg(opt).succeeds().stdout_is(expected_stdout); - } + let expected_stdout = unwrap_or_return!(expected_result(&ts, &["-m"])).stdout_move_str(); + ts.ucmd().arg("-m").succeeds().stdout_is(expected_stdout); } #[cfg(unix)]