D7527: rust-matchers: add doctests for `AlwaysMatcher`
Alphare (Raphaël Gomès)
phabricator at mercurial-scm.org
Tue Dec 10 16:18:12 UTC 2019
Closed by commit rHG542c8b277261: rust-matchers: add doctests for `AlwaysMatcher` (authored by Alphare).
This revision was automatically updated to reflect the committed changes.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D7527?vs=18403&id=18585
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D7527/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D7527
AFFECTED FILES
rust/hg-core/src/matchers.rs
CHANGE DETAILS
diff --git a/rust/hg-core/src/matchers.rs b/rust/hg-core/src/matchers.rs
--- a/rust/hg-core/src/matchers.rs
+++ b/rust/hg-core/src/matchers.rs
@@ -78,6 +78,16 @@
}
/// Matches everything.
+///```
+/// use hg::{ matchers::{Matcher, AlwaysMatcher}, utils::hg_path::HgPath };
+///
+/// let matcher = AlwaysMatcher;
+///
+/// assert_eq!(true, matcher.matches(HgPath::new(b"whatever")));
+/// assert_eq!(true, matcher.matches(HgPath::new(b"b.txt")));
+/// assert_eq!(true, matcher.matches(HgPath::new(b"main.c")));
+/// assert_eq!(true, matcher.matches(HgPath::new(br"re:.*\.c$")));
+/// ```
#[derive(Debug)]
pub struct AlwaysMatcher;
To: Alphare, #hg-reviewers, kevincox, pulkit
Cc: durin42, kevincox, mercurial-devel
More information about the Mercurial-devel
mailing list