Mercurial > public > mercurial-scm > hg
diff rust/hg-core/src/matchers.rs @ 43834: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 | 1bb4e9b02984 |
children | bc7d8f45c3b6 |
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;