Skip to content

Commit

Permalink
test: add coverage test on Regex::as_str
Browse files Browse the repository at this point in the history
  • Loading branch information
vthib committed Jul 9, 2023
1 parent 4ba9190 commit ef0c352
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions boreal/src/regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,14 @@ mod tests {
);
}

#[test]
fn test_regex_as_str() {
// Original expression can be retrieved with the as_str method.
let expr = r"^a+b\wc";
let regex = Regex::from_string(expr.to_owned(), false, false).unwrap();
assert_eq!(regex.as_str(), expr);
}

#[test]
fn test_types_traits() {
test_type_traits(Regex::from_string("a".to_owned(), false, false));
Expand Down

0 comments on commit ef0c352

Please sign in to comment.