Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats committed Jul 26, 2024
1 parent 31129b9 commit d9dceff
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -845,4 +845,21 @@ mod tests {
})
.unwrap();
}

#[test]
fn has_regexp_group() {
let pattern = <UrlPattern>::parse(UrlPatternInit {
pathname: Some("/:foo.".to_owned()),
..Default::default()
})
.unwrap();
assert!(!pattern.has_regexp_groups());

let pattern = <UrlPattern>::parse(UrlPatternInit {
pathname: Some("/(.*?)".to_owned()),
..Default::default()
})
.unwrap();
assert!(pattern.has_regexp_groups());
}
}

0 comments on commit d9dceff

Please sign in to comment.