Skip to content

Commit

Permalink
fixup! test/assert_regex.bats: Test value boundary matches
Browse files Browse the repository at this point in the history
  • Loading branch information
rico-chet committed May 26, 2022
1 parent c7e0700 commit c050578
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions test/assert_regex.bats
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,40 @@ ERR_MSG

@test "assert_regex() <value> <pattern>: line breaks do not match '^' and '$'" {
run assert_regex $'one\ntwo' 'one$'
assert_test_fail
assert_test_fail <<'ERR_MSG'
-- value does not match regular expression --
value (2 lines):
one
two
pattern (1 lines):
one$
--
ERR_MSG

run assert_regex $'one\ntwo' '^two'
assert_test_fail
assert_test_fail <<'ERR_MSG'
-- value does not match regular expression --
value (2 lines):
one
two
pattern (1 lines):
^two
--
ERR_MSG

run assert_regex $'one\ntwo\n' 'two$'
assert_test_fail
assert_test_fail <<'ERR_MSG'
-- value does not match regular expression --
value (2 lines):
one
two
pattern (1 lines):
two$
--
ERR_MSG
}

@test "assert_regex() <value> <pattern>: <value>'s line breaks match multi-line <pattern>'s line breaks" {
Expand Down

0 comments on commit c050578

Please sign in to comment.