Skip to content

Commit

Permalink
Merge pull request #120 from refi64/printf
Browse files Browse the repository at this point in the history
Add support for GNU-compatible printf
  • Loading branch information
sylvestre authored Jan 10, 2022
2 parents d385362 + dd443b9 commit 81402f3
Show file tree
Hide file tree
Showing 8 changed files with 1,475 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ target
.project
.cargo
.settings
test_data/links/link-f
test_data/links/link-d
test_data/links/link-*
222 changes: 222 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ description = "Rust implementation of GNU findutils"
authors = ["uutils developers"]

[dependencies]
chrono = "0.4"
glob = "0.3"
walkdir = "2.3"
tempfile = "3"
regex = "1.5"
once_cell = "1.9"
uucore = { git = "https://github.com/uutils/coreutils", features = ["entries", "fs", "fsext"] }

[dev-dependencies]
assert_cmd = "2"
filetime = "0.2"
predicates = "2"
serial_test = "0.5"

Expand Down
8 changes: 4 additions & 4 deletions src/find/matchers/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl Matcher for DeleteMatcher {

#[cfg(test)]
mod tests {
use std::fs::File;
use std::fs::{create_dir, File};
use tempfile::Builder;

use super::*;
Expand All @@ -79,6 +79,7 @@ mod tests {

let temp_dir_path = temp_dir.path().to_string_lossy();
File::create(temp_dir.path().join("test")).expect("created test file");
create_dir(temp_dir.path().join("test_dir")).expect("created test directory");
let test_entry = get_dir_entry_for(&temp_dir_path, "test");
assert!(
matcher.matches(&test_entry, &mut deps.new_matcher_io()),
Expand All @@ -89,14 +90,13 @@ mod tests {
"DeleteMatcher should actually delete files it matches",
);

let temp_dir_name = temp_dir.path().file_name().unwrap().to_string_lossy();
let temp_dir_entry = get_dir_entry_for(&temp_dir_path, &temp_dir_name);
let temp_dir_entry = get_dir_entry_for(&temp_dir_path, "test_dir");
assert!(
matcher.matches(&temp_dir_entry, &mut deps.new_matcher_io()),
"DeleteMatcher should match directories",
);
assert!(
!temp_dir.path().exists(),
!temp_dir.path().join("test_dir").exists(),
"DeleteMatcher should actually delete (empty) directories it matches",
);
}
Expand Down
Loading

0 comments on commit 81402f3

Please sign in to comment.