Skip to content

Commit

Permalink
test/assert_regex.bats: Test case-insensitive matching
Browse files Browse the repository at this point in the history
  • Loading branch information
rico-chet committed May 28, 2022
1 parent 03bc04c commit edb2300
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/assert_regex.bats
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ ERR_MSG
[ "${BASH_REMATCH[0]}" = 'bcd' ]
}

@test "assert_regex() <value> <pattern>: matches case-insensitively when 'nocasematch' is set" {
shopt -s nocasematch

assert_regex 'aBc' 'ABC'
}

@test "assert_regex() <value> <pattern>: outputs multi-line <value> nicely when it fails" {
run assert_regex $'bcd\n123' '^[a-z]b[c-z]+'
assert_test_fail <<'ERR_MSG'
Expand Down

0 comments on commit edb2300

Please sign in to comment.