mirror of
https://github.com/uutils/findutils.git
synced 2026-06-10 15:48:30 -07:00
Merge branch 'main' into stat
This commit is contained in:
@@ -481,7 +481,7 @@ fn build_matcher_tree(
|
||||
config.depth_first = true;
|
||||
None
|
||||
}
|
||||
"-xdev" => {
|
||||
"-mount" | "-xdev" => {
|
||||
// TODO add warning if it appears after actual testing criterion
|
||||
config.same_file_system = true;
|
||||
None
|
||||
|
||||
@@ -67,6 +67,8 @@ impl FromStr for RegexType {
|
||||
"grep" => Ok(Self::Grep),
|
||||
"posix-basic" => Ok(Self::PosixBasic),
|
||||
"posix-extended" => Ok(Self::PosixExtended),
|
||||
// ed and sed are the same as posix-basic
|
||||
"ed" | "sed" => Ok(Self::PosixBasic),
|
||||
_ => Err(ParseRegexTypeError(s.to_owned())),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,6 +190,34 @@ fn regex_types() {
|
||||
.success()
|
||||
.stderr(predicate::str::is_empty())
|
||||
.stdout(predicate::str::contains("teeest"));
|
||||
|
||||
Command::cargo_bin("find")
|
||||
.expect("found binary")
|
||||
.args(&[
|
||||
&temp_dir_path,
|
||||
"-regextype",
|
||||
"ed",
|
||||
"-regex",
|
||||
&fix_up_regex_slashes(r".*/te\{1,3\}st"),
|
||||
])
|
||||
.assert()
|
||||
.success()
|
||||
.stderr(predicate::str::is_empty())
|
||||
.stdout(predicate::str::contains("teeest"));
|
||||
|
||||
Command::cargo_bin("find")
|
||||
.expect("found binary")
|
||||
.args(&[
|
||||
&temp_dir_path,
|
||||
"-regextype",
|
||||
"sed",
|
||||
"-regex",
|
||||
&fix_up_regex_slashes(r".*/te\{1,3\}st"),
|
||||
])
|
||||
.assert()
|
||||
.success()
|
||||
.stderr(predicate::str::is_empty())
|
||||
.stdout(predicate::str::contains("teeest"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -412,3 +440,26 @@ fn find_links() {
|
||||
.stderr(predicate::str::is_empty())
|
||||
.stdout(predicate::str::contains("abbbc"));
|
||||
}
|
||||
|
||||
#[serial(working_dir)]
|
||||
#[test]
|
||||
fn find_mount_xdev() {
|
||||
// Make sure that -mount/-xdev doesn't prune unexpectedly.
|
||||
// TODO: Test with a mount point in the search.
|
||||
|
||||
Command::cargo_bin("find")
|
||||
.expect("found binary")
|
||||
.args(&["test_data", "-mount"])
|
||||
.assert()
|
||||
.success()
|
||||
.stderr(predicate::str::is_empty())
|
||||
.stdout(predicate::str::contains("abbbc"));
|
||||
|
||||
Command::cargo_bin("find")
|
||||
.expect("found binary")
|
||||
.args(&["test_data", "-xdev"])
|
||||
.assert()
|
||||
.success()
|
||||
.stderr(predicate::str::is_empty())
|
||||
.stdout(predicate::str::contains("abbbc"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user