changeset 43852:542c8b277261

rust-matchers: add doctests for `AlwaysMatcher` Differential Revision: https://phab.mercurial-scm.org/D7527
author Raphaël Gomès <rgomes@octobus.net>
date Fri, 29 Nov 2019 18:53:52 +0100
parents 4f1543a2f5c3
children 94670e124d29
files rust/hg-core/src/matchers.rs
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;