Skip to content

Commit

Permalink
Resolve merge conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
hanbings committed Jun 7, 2024
1 parent bc59d33 commit 0cb923d
Showing 1 changed file with 36 additions and 35 deletions.
71 changes: 36 additions & 35 deletions tests/find_cmd_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,43 @@ fn find_newer_xy() {

#[test]
#[serial(working_dir)]
fn find_age_range() {
let args = ["-amin", "-cmin", "-mmin"];
let times = ["-60", "-120", "-240", "+60", "+120", "+240"];
let time_strings = [
"\"-60\"", "\"-120\"", "\"-240\"", "\"-60\"", "\"-120\"", "\"-240\"",
];

for arg in args {
for time in times {
Command::cargo_bin("find")
.expect("the time should match")
.args(["test_data/simple", arg, time])
.assert()
.success()
.code(0);
}
}

for arg in args {
for time_string in time_strings {
Command::cargo_bin("find")
.expect("the time should not match")
.args(["test_data/simple", arg, time_string])
.assert()
.failure()
.code(1)
.stderr(predicate::str::contains(
"Error: Expected a decimal integer (with optional + or - prefix) argument to",
))
.stdout(predicate::str::is_empty());
}
}
}

#[test]
#[cfg(unix)]
#[serial(working_dir)]
fn find_samefile() {
use std::fs;

Expand Down Expand Up @@ -638,38 +674,3 @@ fn find_samefile() {
.stdout(predicate::str::contains(""))
.stderr(predicate::str::contains("No such file or directory"));
}

#[cfg(unix)]
fn find_age_range() {
let args = ["-amin", "-cmin", "-mmin"];
let times = ["-60", "-120", "-240", "+60", "+120", "+240"];
let time_strings = [
"\"-60\"", "\"-120\"", "\"-240\"", "\"-60\"", "\"-120\"", "\"-240\"",
];

for arg in args {
for time in times {
Command::cargo_bin("find")
.expect("the time should match")
.args(["test_data/simple", arg, time])
.assert()
.success()
.code(0);
}
}

for arg in args {
for time_string in time_strings {
Command::cargo_bin("find")
.expect("the time should not match")
.args(["test_data/simple", arg, time_string])
.assert()
.failure()
.code(1)
.stderr(predicate::str::contains(
"Error: Expected a decimal integer (with optional + or - prefix) argument to",
))
.stdout(predicate::str::is_empty());
}
}
}

0 comments on commit 0cb923d

Please sign in to comment.