summaryrefslogtreecommitdiffstats
path: root/vendor/gix-glob/tests/pattern/matching.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/gix-glob/tests/pattern/matching.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-glob/tests/pattern/matching.rs')
-rw-r--r--vendor/gix-glob/tests/pattern/matching.rs32
1 files changed, 28 insertions, 4 deletions
diff --git a/vendor/gix-glob/tests/pattern/matching.rs b/vendor/gix-glob/tests/pattern/matching.rs
index 8a5208d9a..df29e02dc 100644
--- a/vendor/gix-glob/tests/pattern/matching.rs
+++ b/vendor/gix-glob/tests/pattern/matching.rs
@@ -68,7 +68,13 @@ fn compare_baseline_with_ours() {
);
match std::panic::catch_unwind(|| {
let pattern = pat(pattern);
- pattern.matches_repo_relative_path(value, basename_start_pos(value), None, *case)
+ pattern.matches_repo_relative_path(
+ value,
+ basename_start_pos(value),
+ None,
+ *case,
+ gix_glob::wildmatch::Mode::NO_MATCH_SLASH_LITERAL,
+ )
}) {
Ok(actual_match) => {
if actual_match == is_match {
@@ -105,11 +111,23 @@ fn non_dirs_for_must_be_dir_patterns_are_ignored() {
);
let path = "hello";
assert!(
- !pattern.matches_repo_relative_path(path, None, false.into() /* is-dir */, Case::Sensitive),
+ !pattern.matches_repo_relative_path(
+ path.into(),
+ None,
+ false.into(), /* is-dir */
+ Case::Sensitive,
+ gix_glob::wildmatch::Mode::NO_MATCH_SLASH_LITERAL
+ ),
"non-dirs never match a dir pattern"
);
assert!(
- pattern.matches_repo_relative_path(path, None, true.into() /* is-dir */, Case::Sensitive),
+ pattern.matches_repo_relative_path(
+ path.into(),
+ None,
+ true.into(), /* is-dir */
+ Case::Sensitive,
+ gix_glob::wildmatch::Mode::NO_MATCH_SLASH_LITERAL
+ ),
"dirs can match a dir pattern with the normal rules"
);
}
@@ -317,7 +335,13 @@ fn match_file<'a>(pattern: &gix_glob::Pattern, path: impl Into<&'a BStr>, case:
fn match_path<'a>(pattern: &gix_glob::Pattern, path: impl Into<&'a BStr>, is_dir: Option<bool>, case: Case) -> bool {
let path = path.into();
- pattern.matches_repo_relative_path(path, basename_start_pos(path), is_dir, case)
+ pattern.matches_repo_relative_path(
+ path,
+ basename_start_pos(path),
+ is_dir,
+ case,
+ gix_glob::wildmatch::Mode::NO_MATCH_SLASH_LITERAL,
+ )
}
fn basename_start_pos(value: &BStr) -> Option<usize> {