Skip to content

Commit

Permalink
test: add test for repetitions in patters
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Jul 15, 2019
1 parent 121efb9 commit 616762f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,5 +312,15 @@ mod test {
false
);
}

#[test]
fn debug_rep_pattern() {
let pat = Pattern::new("a+b").unwrap();
assert!(pat.debug_matches(&Str::new("ab")));
assert!(pat.debug_matches(&Str::new("aaaab")));
assert!(pat.debug_matches(&Str::new("aaaaaaaaaab")));
assert_eq!(pat.debug_matches(&Str::new("b")), false);
assert_eq!(pat.debug_matches(&Str::new("abb")), false);
assert_eq!(pat.debug_matches(&Str::new("aaaaabb")), false);
}
}

0 comments on commit 616762f

Please sign in to comment.