rust-matchers: add doctests for `AlwaysMatcher`
authorRaphaël Gomès <rgomes@octobus.net>
Fri, 29 Nov 2019 18:53:52 +0100
changeset 43834 542c8b277261
parent 43833 4f1543a2f5c3
child 43835 94670e124d29
rust-matchers: add doctests for `AlwaysMatcher` Differential Revision: https://phab.mercurial-scm.org/D7527
rust/hg-core/src/matchers.rs
--- a/rust/hg-core/src/matchers.rs	Fri Nov 29 17:24:40 2019 +0100
+++ b/rust/hg-core/src/matchers.rs	Fri Nov 29 18:53:52 2019 +0100
@@ -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;