From caf8d803183ab62bfd7008d3398d7737f5bdd223 Mon Sep 17 00:00:00 2001 From: houseme Date: Mon, 23 Jun 2025 17:30:40 +0800 Subject: [PATCH] fix (#504) --- crates/notify/src/rules/pattern.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/notify/src/rules/pattern.rs b/crates/notify/src/rules/pattern.rs index 2e49d56a2..8d1bfc808 100644 --- a/crates/notify/src/rules/pattern.rs +++ b/crates/notify/src/rules/pattern.rs @@ -78,7 +78,7 @@ mod tests { assert_eq!(new_pattern(Some(""), Some("b")), "*b"); assert_eq!(new_pattern(None, None), ""); assert_eq!(new_pattern(Some("prefix"), Some("suffix")), "prefix*suffix"); - assert_eq!(new_pattern(Some("prefix/"), Some("/suffix")), "prefix/*suffix"); // prefix/* + */suffix -> prefix/**/suffix -> prefix/*/suffix + assert_eq!(new_pattern(Some("prefix/"), Some("/suffix")), "prefix/*/suffix"); // prefix/* + */suffix -> prefix/**/suffix -> prefix/*/suffix } #[test] @@ -91,6 +91,7 @@ mod tests { assert!(match_simple("foo*bar", "foobazbar")); assert!(!match_simple("foo*bar", "foobar_baz")); assert!(match_simple("a*b*c", "axbyc")); - assert!(!match_simple("a*b*c", "axbc")); + assert!(match_simple("a*b*c", "abc")); + assert!(match_simple("a*b*c", "axbc")); } }