Skip to content

Commit

Permalink
Merge branch 'main' into feature/env_string_args_try_with_shell_words
Browse files Browse the repository at this point in the history
  • Loading branch information
cre4ture authored Feb 26, 2024
2 parents e76100b + d8e6f36 commit ab5b5b8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ fts-sys = "0.2"
fundu = "2.0.0"
gcd = "2.3"
glob = "0.3.1"
half = "2.3"
half = "2.4"
hostname = "0.3"
indicatif = "0.17"
itertools = "0.12.1"
Expand Down
2 changes: 1 addition & 1 deletion src/uu/chmod/src/chmod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let recursive = matches.get_flag(options::RECURSIVE);
let fmode = match matches.get_one::<String>(options::REFERENCE) {
Some(fref) => match fs::metadata(fref) {
Ok(meta) => Some(meta.mode()),
Ok(meta) => Some(meta.mode() & 0o7777),
Err(err) => {
return Err(USimpleError::new(
1,
Expand Down
14 changes: 14 additions & 0 deletions tests/by-util/test_chmod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,20 @@ fn test_quiet_n_verbose_used_multiple_times() {
.succeeds();
}

#[test]
fn test_changes_from_identical_reference() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
at.touch("file");
scene
.ucmd()
.arg("-c")
.arg("--reference=file")
.arg("file")
.succeeds()
.no_stdout();
}

#[test]
fn test_gnu_invalid_mode() {
let scene = TestScenario::new(util_name!());
Expand Down
4 changes: 2 additions & 2 deletions tests/by-util/test_uniq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ fn gnu_tests() {
TestCase {
name: "112",
args: &["-D", "-c"],
input: "a a\na b\n",
input: "", // Note: Different from GNU test, but should not matter
stdout: Some(""),
stderr: Some("uniq: printing all duplicated lines and repeat counts is meaningless\nTry 'uniq --help' for more information.\n"),
exit: Some(1),
Expand Down Expand Up @@ -811,7 +811,7 @@ fn gnu_tests() {
TestCase {
name: "119",
args: &["--all-repeated=badoption"],
input: "a a\na b\n",
input: "", // Note: Different from GNU test, but should not matter
stdout: Some(""),
stderr: Some("uniq: invalid argument 'badoption' for '--all-repeated'\nValid arguments are:\n - 'none'\n - 'prepend'\n - 'separate'\nTry 'uniq --help' for more information.\n"),
exit: Some(1),
Expand Down

0 comments on commit ab5b5b8

Please sign in to comment.