Patchwork D7527: rust-matchers: add doctests for `AlwaysMatcher`

login
register
mail settings
Submitter phabricator
Date Dec. 10, 2019, 4:18 p.m.
Message ID <f73471cdb765866d1a15ebff7695269f@localhost.localdomain>
Download mbox | patch
Permalink /patch/43686/
State Not Applicable
Headers show

Comments

phabricator - Dec. 10, 2019, 4:18 p.m.
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




To: Alphare, #hg-reviewers, kevincox, pulkit
Cc: durin42, kevincox, mercurial-devel

Patch

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;