mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-18 18:00:35 +01:00
Add tests for regex_helper
This commit is contained in:
parent
809fd8fb78
commit
9ef9bf7b80
1 changed files with 17 additions and 0 deletions
|
@ -33,3 +33,20 @@ fn hir_has_uppercase_char(hir: &Hir) -> bool {
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn pattern_has_uppercase_char_simple() {
|
||||||
|
assert!(pattern_has_uppercase_char("A"));
|
||||||
|
assert!(pattern_has_uppercase_char("foo.EXE"));
|
||||||
|
|
||||||
|
assert!(!pattern_has_uppercase_char("a"));
|
||||||
|
assert!(!pattern_has_uppercase_char("foo.exe123"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn pattern_has_uppercase_char_advanced() {
|
||||||
|
assert!(pattern_has_uppercase_char("foo.[a-zA-Z]"));
|
||||||
|
|
||||||
|
assert!(!pattern_has_uppercase_char(r"\Acargo"));
|
||||||
|
assert!(!pattern_has_uppercase_char(r"carg\x6F"));
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue