1 Commits

Author SHA1 Message Date
renovate[bot] 647db30e2b Add renovate.json 2023-03-24 09:30:13 +00:00
22 changed files with 243 additions and 414 deletions
-17
View File
@@ -1,17 +0,0 @@
repos:
- repo: local
hooks:
- id: rust-linting
name: Rust linting
description: Run cargo fmt on files included in the commit.
entry: cargo +nightly fmt --
pass_filenames: true
types: [file, rust]
language: system
- id: rust-clippy
name: Rust clippy
description: Run cargo clippy on files included in the commit.
entry: cargo +nightly clippy --workspace --all-targets --all-features --
pass_filenames: false
types: [file, rust]
language: system
Generated
+74 -171
View File
@@ -29,25 +29,12 @@ dependencies = [
"winapi",
]
[[package]]
name = "anstyle"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2"
[[package]]
name = "anstyle"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d"
[[package]]
name = "assert_cmd"
version = "2.0.11"
version = "2.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86d6b683edf8d1119fe420a94f8a7e389239666aa72e65495d91c00462510151"
checksum = "9834fcc22e0874394a010230586367d4a3e9f11b560f469262678547e1d2575e"
dependencies = [
"anstyle 1.0.0",
"bstr",
"doc-comment",
"predicates",
@@ -62,7 +49,7 @@ version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi 0.1.19",
"hermit-abi",
"libc",
"winapi",
]
@@ -149,9 +136,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.24"
version = "0.4.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b"
checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f"
dependencies = [
"iana-time-zone",
"js-sys",
@@ -243,27 +230,6 @@ dependencies = [
"termcolor",
]
[[package]]
name = "errno"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a"
dependencies = [
"errno-dragonfly",
"libc",
"windows-sys 0.48.0",
]
[[package]]
name = "errno-dragonfly"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "faccess"
version = "0.2.4"
@@ -286,19 +252,19 @@ dependencies = [
[[package]]
name = "filetime"
version = "0.2.21"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153"
checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9"
dependencies = [
"cfg-if",
"libc",
"redox_syscall 0.2.10",
"windows-sys 0.48.0",
"redox_syscall",
"windows-sys 0.42.0",
]
[[package]]
name = "findutils"
version = "0.4.1"
version = "0.3.0"
dependencies = [
"assert_cmd",
"chrono",
@@ -423,12 +389,6 @@ dependencies = [
"libc",
]
[[package]]
name = "hermit-abi"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
[[package]]
name = "humantime"
version = "2.1.0"
@@ -458,17 +418,6 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "io-lifetimes"
version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2"
dependencies = [
"hermit-abi 0.3.1",
"libc",
"windows-sys 0.48.0",
]
[[package]]
name = "itertools"
version = "0.10.1"
@@ -501,9 +450,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
version = "0.2.146"
version = "0.2.137"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b"
checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89"
[[package]]
name = "libloading"
@@ -515,12 +464,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "linux-raw-sys"
version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
[[package]]
name = "lock_api"
version = "0.4.7"
@@ -694,7 +637,7 @@ checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929"
dependencies = [
"cfg-if",
"libc",
"redox_syscall 0.2.10",
"redox_syscall",
"smallvec",
"windows-sys 0.36.1",
]
@@ -725,11 +668,10 @@ checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe"
[[package]]
name = "predicates"
version = "3.0.2"
version = "2.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c575290b64d24745b6c57a12a31465f0a66f3a4799686a6921526a33b0797965"
checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd"
dependencies = [
"anstyle 0.3.5",
"difflib",
"float-cmp",
"itertools",
@@ -740,9 +682,9 @@ dependencies = [
[[package]]
name = "predicates-core"
version = "1.0.6"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174"
checksum = "fb3dbeaaf793584e29c58c7e3a82bbb3c7c06b63cea68d13b0e3cddc124104dc"
[[package]]
name = "predicates-tree"
@@ -756,18 +698,18 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.60"
version = "1.0.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406"
checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029"
dependencies = [
"unicode-ident",
"unicode-xid",
]
[[package]]
name = "quote"
version = "1.0.28"
version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488"
checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df"
dependencies = [
"proc-macro2",
]
@@ -781,29 +723,20 @@ dependencies = [
"bitflags",
]
[[package]]
name = "redox_syscall"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
dependencies = [
"bitflags",
]
[[package]]
name = "redox_termios"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8440d8acb4fd3d277125b4bd01a6f38aee8d814b3b5fc09b3f2b825d37d3fe8f"
dependencies = [
"redox_syscall 0.2.10",
"redox_syscall",
]
[[package]]
name = "regex"
version = "1.7.3"
version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d"
checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
dependencies = [
"aho-corasick",
"memchr",
@@ -821,9 +754,18 @@ dependencies = [
[[package]]
name = "regex-syntax"
version = "0.6.29"
version = "0.6.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
[[package]]
name = "remove_dir_all"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
dependencies = [
"winapi",
]
[[package]]
name = "rustc-hash"
@@ -831,20 +773,6 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "rustix"
version = "0.37.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0"
dependencies = [
"bitflags",
"errno",
"io-lifetimes",
"libc",
"linux-raw-sys",
"windows-sys 0.48.0",
]
[[package]]
name = "same-file"
version = "1.0.4"
@@ -868,9 +796,9 @@ checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965"
[[package]]
name = "serial_test"
version = "2.0.0"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e56dd856803e253c8f298af3f4d7eb0ae5e23a737252cd90bb4f3b435033b2d"
checksum = "538c30747ae860d6fb88330addbbd3e0ddbe46d662d032855596d8a8ca260611"
dependencies = [
"dashmap",
"futures",
@@ -882,13 +810,13 @@ dependencies = [
[[package]]
name = "serial_test_derive"
version = "2.0.0"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f"
checksum = "079a83df15f85d89a68d64ae1238f142f172b1fa915d0d76b26a7cba1b659a69"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.18",
"syn",
]
[[package]]
@@ -932,29 +860,18 @@ dependencies = [
"unicode-xid",
]
[[package]]
name = "syn"
version = "2.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "tempfile"
version = "3.6.0"
version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6"
checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
dependencies = [
"autocfg",
"cfg-if",
"fastrand",
"redox_syscall 0.3.5",
"rustix",
"windows-sys 0.48.0",
"libc",
"redox_syscall",
"remove_dir_all",
"winapi",
]
[[package]]
@@ -974,7 +891,7 @@ checksum = "077185e2eac69c3f8379a4298e1e07cd36beb962290d4a51199acf0fdc10607e"
dependencies = [
"libc",
"numtoa",
"redox_syscall 0.2.10",
"redox_syscall",
"redox_termios",
]
@@ -1003,12 +920,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41"
[[package]]
name = "unicode-ident"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0"
[[package]]
name = "unicode-width"
version = "0.1.9"
@@ -1057,11 +968,12 @@ dependencies = [
[[package]]
name = "walkdir"
version = "2.3.3"
version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698"
checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
dependencies = [
"same-file",
"winapi",
"winapi-util",
]
@@ -1086,7 +998,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
"syn 1.0.94",
"syn",
"wasm-bindgen-shared",
]
@@ -1108,7 +1020,7 @@ checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.94",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -1195,33 +1107,24 @@ dependencies = [
[[package]]
name = "windows-sys"
version = "0.48.0"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5"
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc 0.48.0",
"windows_i686_gnu 0.48.0",
"windows_i686_msvc 0.48.0",
"windows_x86_64_gnu 0.48.0",
"windows_aarch64_msvc 0.42.0",
"windows_i686_gnu 0.42.0",
"windows_i686_msvc 0.42.0",
"windows_x86_64_gnu 0.42.0",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc 0.48.0",
"windows_x86_64_msvc 0.42.0",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.48.0"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
[[package]]
name = "windows_aarch64_msvc"
@@ -1231,9 +1134,9 @@ checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
[[package]]
name = "windows_aarch64_msvc"
version = "0.48.0"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
[[package]]
name = "windows_i686_gnu"
@@ -1243,9 +1146,9 @@ checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
[[package]]
name = "windows_i686_gnu"
version = "0.48.0"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
[[package]]
name = "windows_i686_msvc"
@@ -1255,9 +1158,9 @@ checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
[[package]]
name = "windows_i686_msvc"
version = "0.48.0"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
[[package]]
name = "windows_x86_64_gnu"
@@ -1267,15 +1170,15 @@ checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
[[package]]
name = "windows_x86_64_gnu"
version = "0.48.0"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.48.0"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
[[package]]
name = "windows_x86_64_msvc"
@@ -1285,6 +1188,6 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
[[package]]
name = "windows_x86_64_msvc"
version = "0.48.0"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
+3 -3
View File
@@ -1,6 +1,6 @@
[package]
name = "findutils"
version = "0.4.1"
version = "0.3.0"
homepage = "https://github.com/uutils/findutils"
repository = "https://github.com/uutils/findutils"
edition = "2018"
@@ -23,8 +23,8 @@ uucore = { version = "0.0.12", features = ["entries", "fs", "fsext", "mode"] }
assert_cmd = "2"
filetime = "0.2"
nix = "0.26"
predicates = "3"
serial_test = "2.0"
predicates = "2"
serial_test = "1.0"
tempfile = "3"
[[bin]]
+6
View File
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
]
}
+1 -1
View File
@@ -6,7 +6,7 @@
fn main() {
let args = std::env::args().collect::<Vec<String>>();
let strs: Vec<&str> = args.iter().map(std::convert::AsRef::as_ref).collect();
let strs: Vec<&str> = args.iter().map(|s| s.as_ref()).collect();
let deps = findutils::find::StandardDependencies::new();
std::process::exit(findutils::find::find_main(&strs, &deps));
}
+1 -1
View File
@@ -169,7 +169,7 @@ impl Pattern {
Self { regex }
}
/// Test if this pattern matches a string.
/// Test if this patern matches a string.
pub fn matches(&self, string: &str) -> bool {
self.regex.is_match(string)
}
+6 -10
View File
@@ -73,19 +73,15 @@ mod tests {
fn create_file_link() {
#[cfg(unix)]
if let Err(e) = symlink("abbbc", "test_data/links/link-f") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
#[cfg(windows)]
if let Err(e) = symlink_file("abbbc", "test_data/links/link-f") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
}
+2 -2
View File
@@ -530,9 +530,9 @@ mod tests {
#[test]
fn not_has_side_effects_works() {
let has_fx = NotMatcher::new(HasSideEffects);
let has_no_fx = NotMatcher::new(FalseMatcher);
let hasnt_fx = NotMatcher::new(FalseMatcher);
assert!(has_fx.has_side_effects());
assert!(!has_no_fx.has_side_effects());
assert!(!hasnt_fx.has_side_effects());
}
#[test]
+2 -3
View File
@@ -611,7 +611,7 @@ mod tests {
let deps = FakeDependencies::new();
let matcher =
build_top_level_matcher(&[arg, "-name", "does_not_exist"], &mut config).unwrap();
build_top_level_matcher(&[arg, "-name", "doesntexist"], &mut config).unwrap();
assert!(matcher.matches(&abbbc_lower, &mut deps.new_matcher_io()));
assert_eq!(
@@ -652,8 +652,7 @@ mod tests {
config = Config::default();
let matcher =
build_top_level_matcher(&[arg, arg, "-name", "does_not_exist"], &mut config)
.unwrap();
build_top_level_matcher(&[arg, arg, "-name", "doesntexist"], &mut config).unwrap();
assert!(!matcher.matches(&abbbc_lower, &mut deps.new_matcher_io()));
}
+6 -10
View File
@@ -47,19 +47,15 @@ mod tests {
fn create_file_link() {
#[cfg(unix)]
if let Err(e) = symlink("abbbc", "test_data/links/link-f") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
#[cfg(windows)]
if let Err(e) = symlink_file("abbbc", "test_data/links/link-f") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
}
+1 -1
View File
@@ -223,7 +223,7 @@ mod tests {
PermMatcher::new("d=rwx,g=rx,o+r").expect_err("invalid category should fail");
PermMatcher::new("u=dwx,g=rx,o+r").expect_err("invalid permission bit should fail");
PermMatcher::new("u_rwx,g=rx,o+r")
.expect_err("invalid category/permission separator should fail");
.expect_err("invalid category/permissoin separator should fail");
PermMatcher::new("77777777777777").expect_err("overflowing octal value should fail");
// FIXME: uucore::mode shouldn't accept this
+29 -47
View File
@@ -396,7 +396,7 @@ fn format_directive<'entry>(
// NOTE ON QUOTING:
// GNU find's man page claims that several directives that print names (like
// %f) are quoted like ls; however, I could not reproduce this at all in
// practice, thus the set of rules is undoubtedly very different (if this is
// pratice, thus the set of rules is undoubtedly very different (if this is
// still done at all).
let res: Cow<'entry, str> = match directive {
@@ -467,7 +467,7 @@ fn format_directive<'entry>(
.into_iter()
.find(|fs| fs.dev_id == dev_id)
.map(|fs| fs.fs_type)
.unwrap_or_else(String::new)
.unwrap_or_else(|| "".to_owned())
.into()
}
@@ -946,70 +946,52 @@ mod tests {
#[cfg(unix)]
{
if let Err(e) = symlink("abbbc", "test_data/links/link-f") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink("subdir", "test_data/links/link-d") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink("missing", "test_data/links/link-missing") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink("abbbc/x", "test_data/links/link-notdir") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink("link-loop", "test_data/links/link-loop") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
}
#[cfg(windows)]
{
if let Err(e) = symlink_file("abbbc", "test_data/links/link-f") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink_dir("subdir", "test_data/links/link-d") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink_file("missing", "test_data/links/link-missing") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink_file("abbbc/x", "test_data/links/link-notdir") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
}
+3 -3
View File
@@ -261,7 +261,7 @@ mod tests {
deps.set_time(files_mtime - Duration::new(1_u64, 0));
assert!(
!exactly_one_day_matcher.matches(&file, &mut deps.new_matcher_io()),
"future-modified file shouldn't match exactly 1 day old"
"future-modified file shouldn'1 match exactly 1 day old"
);
assert!(
!more_than_one_day_matcher.matches(&file, &mut deps.new_matcher_io()),
@@ -311,14 +311,14 @@ mod tests {
}
thread::sleep(Duration::from_secs(2));
// read the file again - potentially changing accessed time
// read the file agaion - potentially changing accessed time
{
let mut f = File::open(&foo_path).expect("open temp file");
let _ = f.read(&mut buffer);
}
// OK our modification time and creation time should definitely be different
// and depending on our platform and file system, our accessed time might be
// and depending on our platform and file system, our accessed time migh be
// different too.
let file_info = get_dir_entry_for(&temp_dir.path().to_string_lossy(), "foo");
+18 -26
View File
@@ -87,7 +87,7 @@ mod tests {
let dir = get_dir_entry_for("test_data", "simple");
let deps = FakeDependencies::new();
let matcher = TypeMatcher::new("f").unwrap();
let matcher = TypeMatcher::new(&"f".to_string()).unwrap();
assert!(!matcher.matches(&dir, &mut deps.new_matcher_io()));
assert!(matcher.matches(&file, &mut deps.new_matcher_io()));
}
@@ -98,7 +98,7 @@ mod tests {
let dir = get_dir_entry_for("test_data", "simple");
let deps = FakeDependencies::new();
let matcher = TypeMatcher::new("d").unwrap();
let matcher = TypeMatcher::new(&"d".to_string()).unwrap();
assert!(matcher.matches(&dir, &mut deps.new_matcher_io()));
assert!(!matcher.matches(&file, &mut deps.new_matcher_io()));
}
@@ -108,37 +108,29 @@ mod tests {
#[test]
fn link_type_matcher() {
#[cfg(unix)]
{
let _ = {
if let Err(e) = symlink("abbbc", "test_data/links/link-f") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink("subdir", "test_data/links/link-d") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
};
#[cfg(windows)]
let _ = {
if let Err(e) = symlink_file("abbbc", "test_data/links/link-f") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink_dir("subdir", "test_data/links/link-d") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
};
@@ -148,7 +140,7 @@ mod tests {
let dir = get_dir_entry_for("test_data", "links");
let deps = FakeDependencies::new();
let matcher = TypeMatcher::new("l").unwrap();
let matcher = TypeMatcher::new(&"l".to_string()).unwrap();
assert!(!matcher.matches(&dir, &mut deps.new_matcher_io()));
assert!(!matcher.matches(&file, &mut deps.new_matcher_io()));
assert!(matcher.matches(&link_f, &mut deps.new_matcher_io()));
@@ -163,7 +155,7 @@ mod tests {
let deps = FakeDependencies::new();
for typ in &["b", "c", "p", "s"] {
let matcher = TypeMatcher::new(typ.as_ref()).unwrap();
let matcher = TypeMatcher::new(&typ.to_string()).unwrap();
assert!(!matcher.matches(&dir, &mut deps.new_matcher_io()));
assert!(!matcher.matches(&file, &mut deps.new_matcher_io()));
}
@@ -171,7 +163,7 @@ mod tests {
#[test]
fn cant_create_with_invalid_pattern() {
let result = TypeMatcher::new("xxx");
let result = TypeMatcher::new(&"xxx".to_string());
assert!(result.is_err());
}
}
+7 -11
View File
@@ -338,19 +338,15 @@ mod tests {
fn create_file_link() {
#[cfg(unix)]
if let Err(e) = symlink("abbbc", "test_data/links/link-f") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
#[cfg(windows)]
if let Err(e) = symlink_file("abbbc", "test_data/links/link-f") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
}
@@ -642,7 +638,7 @@ mod tests {
assert_eq!(rc, 0);
assert_eq!(
deps.get_output_as_string(),
new_dir.path().to_string_lossy().to_string() + "\n"
(&new_dir).path().to_string_lossy().to_string() + "\n"
);
// now do it the other way around, and nothing should be output
+5 -6
View File
@@ -37,7 +37,7 @@ fn open_file(destination_dir: &str) -> File {
loop {
file_number += 1;
let mut file_path: PathBuf = PathBuf::from(destination_dir);
file_path.push(format!("{file_number}.txt"));
file_path.push(format!("{}.txt", file_number));
if let Ok(f) = OpenOptions::new()
.write(true)
.create_new(true)
@@ -68,7 +68,7 @@ fn write_content(mut f: impl Write, config: &Config, args: &[String]) {
// the destination_dir we want to write to. Don't write either of those
// as they'll be non-deterministic.
for arg in &args[2..] {
writeln!(f, "{arg}").expect("failed to write to file");
writeln!(f, "{}", arg).expect("failed to write to file");
}
}
@@ -78,14 +78,13 @@ fn main() {
usage();
}
let mut config = Config {
destination_dir: if args[1] == "-" {
None
} else {
destination_dir: if args[1] != "-" {
Some(args[1].clone())
} else {
None
},
..Default::default()
};
for arg in &args[2..] {
if arg.starts_with("--") {
match arg.as_ref() {
+1 -4
View File
@@ -7,9 +7,6 @@
fn main() {
let args = std::env::args().collect::<Vec<String>>();
std::process::exit(findutils::xargs::xargs_main(
&args
.iter()
.map(std::convert::AsRef::as_ref)
.collect::<Vec<&str>>(),
&args.iter().map(|s| s.as_ref()).collect::<Vec<&str>>(),
))
}
+2 -2
View File
@@ -14,7 +14,7 @@ use walkdir::{DirEntry, WalkDir};
use findutils::find::matchers::MatcherIO;
use findutils::find::Dependencies;
/// A copy of `find::tests::FakeDependencies`.
/// A copy of find::tests::FakeDependencies.
/// TODO: find out how to share #[cfg(test)] functions/structs between unit
/// and integration tests.
pub struct FakeDependencies {
@@ -81,7 +81,7 @@ pub fn fix_up_slashes(path: &str) -> String {
path.to_string()
}
/// A copy of `find::tests::FakeDependencies`.
/// A copy of find::tests::FakeDependencies.
/// TODO: find out how to share #[cfg(test)] functions/structs between unit
/// and integration tests.
pub fn get_dir_entry_for(directory: &str, filename: &str) -> DirEntry {
+3 -5
View File
@@ -4,7 +4,7 @@
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
/// ! This file contains what would be normally be unit tests for `find::matchers::exec`.
/// ! This file contains what would be normally be unit tests for find::matchers::exec.
/// ! But as the tests require running an external executable, they need to be run
/// ! as integration tests so we can ensure that our testing-commandline binary
/// ! has been built.
@@ -17,10 +17,8 @@ use std::io::Read;
use tempfile::Builder;
use walkdir::WalkDir;
use common::test_helpers::{
fix_up_slashes, get_dir_entry_for, path_to_testing_commandline, FakeDependencies,
};
use findutils::find::matchers::exec::SingleExecMatcher;
use common::test_helpers::*;
use findutils::find::matchers::exec::*;
use findutils::find::matchers::Matcher;
mod common;
+60 -78
View File
@@ -1,6 +1,6 @@
// Copyright 2021 Chad Williamson <chad@dahc.us>
//
// Use of this source code is governed by an MIT-style license that can be
// Use of this source code is governed by an MIT-syle license that can be
// found in the LICENSE file or at https://opensource.org/licenses/MIT.
// This file contains integration tests for the find command.
@@ -22,7 +22,7 @@ use std::os::unix::fs::symlink;
#[cfg(windows)]
use std::os::windows::fs::{symlink_dir, symlink_file};
use common::test_helpers::fix_up_slashes;
use common::test_helpers::*;
mod common;
@@ -54,7 +54,7 @@ fn no_args() {
fn two_matchers_both_match() {
Command::cargo_bin("find")
.expect("found binary")
.args(["-type", "d", "-name", "test_data"])
.args(&["-type", "d", "-name", "test_data"])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -66,7 +66,7 @@ fn two_matchers_both_match() {
fn two_matchers_one_matches() {
Command::cargo_bin("find")
.expect("found binary")
.args(["-type", "f", "-name", "test_data"])
.args(&["-type", "f", "-name", "test_data"])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -83,7 +83,7 @@ fn matcher_with_side_effects_at_end() {
Command::cargo_bin("find")
.expect("found binary")
.args([&temp_dir_path, "-name", "test", "-delete"])
.args(&[&temp_dir_path, "-name", "test", "-delete"])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -103,7 +103,7 @@ fn matcher_with_side_effects_in_front() {
Command::cargo_bin("find")
.expect("found binary")
.args([&temp_dir_path, "-delete", "-name", "test"])
.args(&[&temp_dir_path, "-delete", "-name", "test"])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -123,12 +123,12 @@ fn matcher_with_side_effects_in_front() {
fn delete_on_dot_dir() {
let temp_dir = Builder::new().prefix("example").tempdir().unwrap();
let original_dir = env::current_dir().unwrap();
env::set_current_dir(temp_dir.path()).expect("working dir changed");
env::set_current_dir(&temp_dir.path()).expect("working dir changed");
// "." should be matched (confirmed by the print), but not deleted.
Command::cargo_bin("find")
.expect("found binary")
.args([".", "-delete", "-print"])
.args(&[".", "-delete", "-print"])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -145,11 +145,11 @@ fn regex_types() {
let temp_dir_path = temp_dir.path().to_string_lossy();
let test_file = temp_dir.path().join("teeest");
File::create(test_file).expect("created test file");
File::create(&test_file).expect("created test file");
Command::cargo_bin("find")
.expect("found binary")
.args([&temp_dir_path, "-regex", &fix_up_regex_slashes(".*/tE+st")])
.args(&[&temp_dir_path, "-regex", &fix_up_regex_slashes(".*/tE+st")])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -157,7 +157,7 @@ fn regex_types() {
Command::cargo_bin("find")
.expect("found binary")
.args([&temp_dir_path, "-iregex", &fix_up_regex_slashes(".*/tE+st")])
.args(&[&temp_dir_path, "-iregex", &fix_up_regex_slashes(".*/tE+st")])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -165,7 +165,7 @@ fn regex_types() {
Command::cargo_bin("find")
.expect("found binary")
.args([
.args(&[
&temp_dir_path,
"-regextype",
"posix-basic",
@@ -179,7 +179,7 @@ fn regex_types() {
Command::cargo_bin("find")
.expect("found binary")
.args([
.args(&[
&temp_dir_path,
"-regextype",
"posix-extended",
@@ -193,7 +193,7 @@ fn regex_types() {
Command::cargo_bin("find")
.expect("found binary")
.args([
.args(&[
&temp_dir_path,
"-regextype",
"ed",
@@ -207,7 +207,7 @@ fn regex_types() {
Command::cargo_bin("find")
.expect("found binary")
.args([
.args(&[
&temp_dir_path,
"-regextype",
"sed",
@@ -227,18 +227,18 @@ fn empty_files() {
Command::cargo_bin("find")
.expect("found binary")
.args([&temp_dir_path, "-empty"])
.args(&[&temp_dir_path, "-empty"])
.assert()
.success()
.stderr(predicate::str::is_empty())
.stdout(fix_up_slashes(&format!("{temp_dir_path}\n")));
.stdout(fix_up_slashes(&format!("{}\n", temp_dir_path)));
let test_file_path = temp_dir.path().join("test");
let mut test_file = File::create(&test_file_path).unwrap();
Command::cargo_bin("find")
.expect("found binary")
.args([&temp_dir_path, "-empty"])
.args(&[&temp_dir_path, "-empty"])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -252,7 +252,7 @@ fn empty_files() {
Command::cargo_bin("find")
.expect("found binary")
.args([&temp_dir_path, "-empty", "-sorted"])
.args(&[&temp_dir_path, "-empty", "-sorted"])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -267,7 +267,7 @@ fn empty_files() {
Command::cargo_bin("find")
.expect("found binary")
.args([&temp_dir_path, "-empty", "-sorted"])
.args(&[&temp_dir_path, "-empty", "-sorted"])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -283,76 +283,58 @@ fn find_printf() {
#[cfg(unix)]
{
if let Err(e) = symlink("abbbc", "test_data/links/link-f") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink("subdir", "test_data/links/link-d") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink("missing", "test_data/links/link-missing") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink("abbbc/x", "test_data/links/link-notdir") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink("link-loop", "test_data/links/link-loop") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
}
#[cfg(windows)]
{
if let Err(e) = symlink_file("abbbc", "test_data/links/link-f") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink_dir("subdir", "test_data/links/link-d") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink_file("missing", "test_data/links/link-missing") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
if let Err(e) = symlink_file("abbbc/x", "test_data/links/link-notdir") {
assert!(
e.kind() == ErrorKind::AlreadyExists,
"Failed to create sym link: {:?}",
e
);
if e.kind() != ErrorKind::AlreadyExists {
panic!("Failed to create sym link: {:?}", e);
}
}
}
Command::cargo_bin("find")
.expect("found binary")
.args([
.args(&[
&fix_up_slashes("./test_data/simple"),
"-sorted",
"-printf",
@@ -374,7 +356,7 @@ fn find_printf() {
Command::cargo_bin("find")
.expect("found binary")
.args([
.args(&[
&fix_up_slashes("./test_data/links"),
"-sorted",
"-type",
@@ -408,19 +390,19 @@ fn find_printf() {
fn find_perm() {
Command::cargo_bin("find")
.expect("found binary")
.args(["-perm", "+rwx"])
.args(&["-perm", "+rwx"])
.assert()
.success();
Command::cargo_bin("find")
.expect("found binary")
.args(["-perm", "u+rwX"])
.args(&["-perm", "u+rwX"])
.assert()
.success();
Command::cargo_bin("find")
.expect("found binary")
.args(["-perm", "u=g"])
.args(&["-perm", "u=g"])
.assert()
.success();
}
@@ -439,7 +421,7 @@ fn find_inum() {
Command::cargo_bin("find")
.expect("found binary")
.args(["test_data", "-inum", &inum])
.args(&["test_data", "-inum", &inum])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -452,7 +434,7 @@ fn find_inum() {
fn find_links() {
Command::cargo_bin("find")
.expect("found binary")
.args(["test_data", "-links", "1"])
.args(&["test_data", "-links", "1"])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -467,7 +449,7 @@ fn find_mount_xdev() {
Command::cargo_bin("find")
.expect("found binary")
.args(["test_data", "-mount"])
.args(&["test_data", "-mount"])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -475,7 +457,7 @@ fn find_mount_xdev() {
Command::cargo_bin("find")
.expect("found binary")
.args(["test_data", "-xdev"])
.args(&["test_data", "-xdev"])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -484,10 +466,10 @@ fn find_mount_xdev() {
#[serial(working_dir)]
#[test]
fn find_accessible() {
fn find_accessable() {
Command::cargo_bin("find")
.expect("found binary")
.args(["test_data", "-readable"])
.args(&["test_data", "-readable"])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -495,7 +477,7 @@ fn find_accessible() {
Command::cargo_bin("find")
.expect("found binary")
.args(["test_data", "-writable"])
.args(&["test_data", "-writable"])
.assert()
.success()
.stderr(predicate::str::is_empty())
@@ -504,7 +486,7 @@ fn find_accessible() {
#[cfg(unix)]
Command::cargo_bin("find")
.expect("found binary")
.args(["test_data", "-executable"])
.args(&["test_data", "-executable"])
.assert()
.success()
.stderr(predicate::str::is_empty())

Some files were not shown because too many files have changed in this diff Show More