Skip to content

Commit

Permalink
test(pattern): Add single alternate group tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dav1dde committed Aug 16, 2024
1 parent ee2f764 commit dc5e297
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions relay-pattern/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,9 @@ mod tests {

#[test]
fn test_alternates() {
assert_pattern!("{foo}", "foo");
assert_pattern!("{foo}", NOT "fOo");
assert_pattern!("{foo}", NOT "bar");
assert_pattern!("{foo,bar}", "foo");
assert_pattern!("{foo,bar}", "bar");
assert_pattern!("{foo,bar}", NOT "Foo");
Expand Down Expand Up @@ -1295,11 +1298,15 @@ mod tests {

#[test]
fn test_alternates_case_insensitive() {
assert_pattern!("{foo}", "foo", i);
assert_pattern!("{foo}", "fOo", i);
assert_pattern!("{foo}", NOT "bar", i);
assert_pattern!("{foo,bar}", "foo", i);
assert_pattern!("{foo,bar}", "bar", i);
assert_pattern!("{foo,bar}", "Foo", i);
assert_pattern!("{foo,bar}", "fOo", i);
assert_pattern!("{foo,bar}", "BAR", i);
assert_pattern!("{foo,bar}", NOT "bao", i);
assert_pattern!("{f[o0-9]o,b[a]r}", "foo", i);
assert_pattern!("{f[o0-9]o,b[a]r}", "fOo", i);
assert_pattern!("{f[o0-9]o,b[a]r}", "f1o", i);
Expand Down

0 comments on commit dc5e297

Please sign in to comment.