From 847520357cbbd53a2ac4cf2ef0357015355fd544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Sat, 17 Jul 2021 01:33:39 +1200 Subject: [PATCH] Rename ignore test fns --- lib/src/gitignore.rs | 26 +++++++++++++------------- lib/src/ignore.rs | 26 +++++++++++++------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/lib/src/gitignore.rs b/lib/src/gitignore.rs index dcd4e36..a8bd372 100644 --- a/lib/src/gitignore.rs +++ b/lib/src/gitignore.rs @@ -254,35 +254,35 @@ mod tests { } #[test] - fn test_matches_exact() { + fn matches_exact() { let file = build_gitignore("Cargo.toml"); assert!(file.is_excluded(&base_dir().join("Cargo.toml"))); } #[test] - fn test_does_not_match() { + fn does_not_match() { let file = build_gitignore("Cargo.toml"); assert!(!file.is_excluded(&base_dir().join("src").join("main.rs"))); } #[test] - fn test_matches_simple_wildcard() { + fn matches_simple_wildcard() { let file = build_gitignore("targ*"); assert!(file.is_excluded(&base_dir().join("target"))); } #[test] - fn test_matches_subdir_exact() { + fn matches_subdir_exact() { let file = build_gitignore("target"); assert!(file.is_excluded(&base_dir().join("target/"))); } #[test] - fn test_matches_subdir() { + fn matches_subdir() { let file = build_gitignore("target"); assert!(file.is_excluded(&base_dir().join("target").join("file"))); @@ -290,7 +290,7 @@ mod tests { } #[test] - fn test_wildcard_with_dir() { + fn wildcard_with_dir() { let file = build_gitignore("target/f*"); assert!(file.is_excluded(&base_dir().join("target").join("file"))); @@ -298,7 +298,7 @@ mod tests { } #[test] - fn test_leading_slash() { + fn leading_slash() { let file = build_gitignore("/*.c"); assert!(file.is_excluded(&base_dir().join("cat-file.c"))); @@ -306,7 +306,7 @@ mod tests { } #[test] - fn test_leading_double_wildcard() { + fn leading_double_wildcard() { let file = build_gitignore("**/foo"); assert!(file.is_excluded(&base_dir().join("foo"))); @@ -315,7 +315,7 @@ mod tests { } #[test] - fn test_trailing_double_wildcard() { + fn trailing_double_wildcard() { let file = build_gitignore("abc/**"); assert!(!file.is_excluded(&base_dir().join("def").join("foo"))); @@ -324,7 +324,7 @@ mod tests { } #[test] - fn test_sandwiched_double_wildcard() { + fn sandwiched_double_wildcard() { let file = build_gitignore("a/**/b"); assert!(file.is_excluded(&base_dir().join("a").join("b"))); @@ -333,7 +333,7 @@ mod tests { } #[test] - fn test_empty_file_never_excludes() { + fn empty_file_never_excludes() { let file = GitignoreFile::from_strings(&[], &base_dir()).expect("test gitignore file invalid"); @@ -341,7 +341,7 @@ mod tests { } #[test] - fn test_checks_all_patterns() { + fn checks_all_patterns() { let patterns = vec!["target", "target2"]; let file = GitignoreFile::from_strings(&patterns, &base_dir()) .expect("test gitignore file invalid"); @@ -351,7 +351,7 @@ mod tests { } #[test] - fn test_handles_whitelisting() { + fn handles_negative_patterns() { let patterns = vec!["target", "!target/foo.txt"]; let file = GitignoreFile::from_strings(&patterns, &base_dir()) .expect("test gitignore file invalid"); diff --git a/lib/src/ignore.rs b/lib/src/ignore.rs index 94503cb..e9d5e2d 100644 --- a/lib/src/ignore.rs +++ b/lib/src/ignore.rs @@ -259,35 +259,35 @@ mod tests { } #[test] - fn test_matches_exact() { + fn matches_exact() { let file = build_ignore("Cargo.toml"); assert!(file.is_excluded(&base_dir().join("Cargo.toml"))); } #[test] - fn test_does_not_match() { + fn does_not_match() { let file = build_ignore("Cargo.toml"); assert!(!file.is_excluded(&base_dir().join("src").join("main.rs"))); } #[test] - fn test_matches_simple_wildcard() { + fn matches_simple_wildcard() { let file = build_ignore("targ*"); assert!(file.is_excluded(&base_dir().join("target"))); } #[test] - fn test_matches_subdir_exact() { + fn matches_subdir_exact() { let file = build_ignore("target"); assert!(file.is_excluded(&base_dir().join("target/"))); } #[test] - fn test_matches_subdir() { + fn matches_subdir() { let file = build_ignore("target"); assert!(file.is_excluded(&base_dir().join("target").join("file"))); @@ -295,7 +295,7 @@ mod tests { } #[test] - fn test_wildcard_with_dir() { + fn wildcard_with_dir() { let file = build_ignore("target/f*"); assert!(file.is_excluded(&base_dir().join("target").join("file"))); @@ -303,7 +303,7 @@ mod tests { } #[test] - fn test_leading_slash() { + fn leading_slash() { let file = build_ignore("/*.c"); assert!(file.is_excluded(&base_dir().join("cat-file.c"))); @@ -311,7 +311,7 @@ mod tests { } #[test] - fn test_leading_double_wildcard() { + fn leading_double_wildcard() { let file = build_ignore("**/foo"); assert!(file.is_excluded(&base_dir().join("foo"))); @@ -320,7 +320,7 @@ mod tests { } #[test] - fn test_trailing_double_wildcard() { + fn trailing_double_wildcard() { let file = build_ignore("abc/**"); assert!(!file.is_excluded(&base_dir().join("def").join("foo"))); @@ -329,7 +329,7 @@ mod tests { } #[test] - fn test_sandwiched_double_wildcard() { + fn sandwiched_double_wildcard() { let file = build_ignore("a/**/b"); assert!(file.is_excluded(&base_dir().join("a").join("b"))); @@ -338,14 +338,14 @@ mod tests { } #[test] - fn test_empty_file_never_excludes() { + fn empty_file_never_excludes() { let file = IgnoreFile::from_strings(&[], &base_dir()).expect("test ignore file invalid"); assert!(!file.is_excluded(&base_dir().join("target"))); } #[test] - fn test_checks_all_patterns() { + fn checks_all_patterns() { let patterns = vec!["target", "target2"]; let file = IgnoreFile::from_strings(&patterns, &base_dir()).expect("test ignore file invalid"); @@ -355,7 +355,7 @@ mod tests { } #[test] - fn test_handles_whitelisting() { + fn handles_whitelisting() { let patterns = vec!["target", "!target/foo.txt"]; let file = IgnoreFile::from_strings(&patterns, &base_dir()).expect("test ignore file invalid");