From 6be211a3360d0399f141c10e178f9ef3692cd693 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Fri, 7 Apr 2023 08:26:35 +0800 Subject: [PATCH] Fix spelling --- src/find/matchers/glob.rs | 2 +- src/find/matchers/logical_matchers.rs | 4 ++-- src/find/matchers/mod.rs | 5 +++-- src/find/matchers/perm.rs | 2 +- src/find/matchers/printf.rs | 2 +- src/find/matchers/time.rs | 6 +++--- tests/find_cmd_tests.rs | 4 ++-- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/find/matchers/glob.rs b/src/find/matchers/glob.rs index 5695d1d..c0b9d80 100644 --- a/src/find/matchers/glob.rs +++ b/src/find/matchers/glob.rs @@ -169,7 +169,7 @@ impl Pattern { Self { regex } } - /// Test if this patern matches a string. + /// Test if this pattern matches a string. pub fn matches(&self, string: &str) -> bool { self.regex.is_match(string) } diff --git a/src/find/matchers/logical_matchers.rs b/src/find/matchers/logical_matchers.rs index 877db3f..6fc5ea3 100644 --- a/src/find/matchers/logical_matchers.rs +++ b/src/find/matchers/logical_matchers.rs @@ -530,9 +530,9 @@ mod tests { #[test] fn not_has_side_effects_works() { let has_fx = NotMatcher::new(HasSideEffects); - let hasnt_fx = NotMatcher::new(FalseMatcher); + let has_no_fx = NotMatcher::new(FalseMatcher); assert!(has_fx.has_side_effects()); - assert!(!hasnt_fx.has_side_effects()); + assert!(!has_no_fx.has_side_effects()); } #[test] diff --git a/src/find/matchers/mod.rs b/src/find/matchers/mod.rs index abcda37..d46a12f 100644 --- a/src/find/matchers/mod.rs +++ b/src/find/matchers/mod.rs @@ -611,7 +611,7 @@ mod tests { let deps = FakeDependencies::new(); let matcher = - build_top_level_matcher(&[arg, "-name", "doesntexist"], &mut config).unwrap(); + build_top_level_matcher(&[arg, "-name", "does_not_exist"], &mut config).unwrap(); assert!(matcher.matches(&abbbc_lower, &mut deps.new_matcher_io())); assert_eq!( @@ -652,7 +652,8 @@ mod tests { config = Config::default(); let matcher = - build_top_level_matcher(&[arg, arg, "-name", "doesntexist"], &mut config).unwrap(); + build_top_level_matcher(&[arg, arg, "-name", "does_not_exist"], &mut config) + .unwrap(); assert!(!matcher.matches(&abbbc_lower, &mut deps.new_matcher_io())); } diff --git a/src/find/matchers/perm.rs b/src/find/matchers/perm.rs index 69f9def..34cc780 100644 --- a/src/find/matchers/perm.rs +++ b/src/find/matchers/perm.rs @@ -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/permissoin separator should fail"); + .expect_err("invalid category/permission separator should fail"); PermMatcher::new("77777777777777").expect_err("overflowing octal value should fail"); // FIXME: uucore::mode shouldn't accept this diff --git a/src/find/matchers/printf.rs b/src/find/matchers/printf.rs index 586f4ed..a576f88 100644 --- a/src/find/matchers/printf.rs +++ b/src/find/matchers/printf.rs @@ -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 - // pratice, thus the set of rules is undoubtedly very different (if this is + // practice, thus the set of rules is undoubtedly very different (if this is // still done at all). let res: Cow<'entry, str> = match directive { diff --git a/src/find/matchers/time.rs b/src/find/matchers/time.rs index ad9654e..a9bdc7f 100644 --- a/src/find/matchers/time.rs +++ b/src/find/matchers/time.rs @@ -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'1 match exactly 1 day old" + "future-modified file shouldn't 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 agaion - potentially changing accessed time + // read the file again - 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 migh be + // and depending on our platform and file system, our accessed time might be // different too. let file_info = get_dir_entry_for(&temp_dir.path().to_string_lossy(), "foo"); diff --git a/tests/find_cmd_tests.rs b/tests/find_cmd_tests.rs index 518b12a..b770d69 100644 --- a/tests/find_cmd_tests.rs +++ b/tests/find_cmd_tests.rs @@ -1,6 +1,6 @@ // Copyright 2021 Chad Williamson // -// Use of this source code is governed by an MIT-syle license that can be +// Use of this source code is governed by an MIT-style 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. @@ -476,7 +476,7 @@ fn find_mount_xdev() { #[serial(working_dir)] #[test] -fn find_accessable() { +fn find_accessible() { Command::cargo_bin("find") .expect("found binary") .args(["test_data", "-readable"])