Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions test/assert_line.bats
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,17 @@ ERR_MSG
run assert_line --regexp '[.*'

if (( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >=3) )); then
assert_test_fail <<'ERR_MSG'
[[ "$output" =~ "invalid regular expression "([^$'\n']+) ]]
cat <<ERR_MSG

-- ERROR: assert_line --
invalid regular expression ${BASH_REMATCH[1]}
--
ERR_MSG
assert_test_fail <<ERR_MSG

-- ERROR: assert_line --
invalid regular expression `[.*': Missing ']'
invalid regular expression ${BASH_REMATCH[1]}
--
ERR_MSG
else
Expand Down
5 changes: 3 additions & 2 deletions test/assert_output.bats
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,11 @@ ERR_MSG
run assert_output --regexp '[.*'

if (( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >=3) )); then
assert_test_fail <<'ERR_MSG'
[[ "$output" =~ "invalid regular expression "([^$'\n']+) ]]
assert_test_fail <<ERR_MSG

-- ERROR: assert_output --
invalid regular expression `[.*': Missing ']'
invalid regular expression ${BASH_REMATCH[1]}
--
ERR_MSG
else
Expand Down
5 changes: 3 additions & 2 deletions test/assert_regex.bats
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ ERR_MSG
run assert_regex value '[.*'

if (( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >=3) )); then
assert_test_fail <<'ERR_MSG'
[[ "$output" =~ "invalid regular expression "([^$'\n']+) ]]
assert_test_fail <<ERR_MSG

-- ERROR: assert_regex --
invalid regular expression `[.*': Missing ']'
invalid regular expression ${BASH_REMATCH[1]}
--
ERR_MSG
else
Expand Down
5 changes: 3 additions & 2 deletions test/assert_stderr.bats
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,11 @@ ERR_MSG
run assert_stderr --regexp '[.*'

if (( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >=3) )); then
assert_test_fail <<'ERR_MSG'
[[ "$output" =~ "invalid regular expression "([^$'\n']+) ]]
assert_test_fail <<ERR_MSG

-- ERROR: assert_stderr --
invalid regular expression `[.*': Missing ']'
invalid regular expression ${BASH_REMATCH[1]}
--
ERR_MSG
else
Expand Down
5 changes: 3 additions & 2 deletions test/assert_stderr_line.bats
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,11 @@ ERR_MSG
run assert_stderr_line --regexp '[.*'

if (( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >=3) )); then
assert_test_fail <<'ERR_MSG'
[[ "$output" =~ "invalid regular expression "([^$'\n']+) ]]
assert_test_fail <<ERR_MSG

-- ERROR: assert_stderr_line --
invalid regular expression `[.*': Missing ']'
invalid regular expression ${BASH_REMATCH[1]}
--
ERR_MSG
else
Expand Down
5 changes: 3 additions & 2 deletions test/refute_line.bats
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,11 @@ ERR_MSG
run refute_line --regexp '[.*'

if (( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >=3) )); then
assert_test_fail <<'ERR_MSG'
[[ "$output" =~ "invalid regular expression "([^$'\n']+) ]]
assert_test_fail <<ERR_MSG

-- ERROR: refute_line --
invalid regular expression `[.*': Missing ']'
invalid regular expression ${BASH_REMATCH[1]}
--
ERR_MSG
else
Expand Down
5 changes: 3 additions & 2 deletions test/refute_output.bats
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,11 @@ ERR_MSG
@test 'refute_output() --regexp <regexp>: returns 1 and displays an error message if <regexp> is not a valid extended regular expression' {
run refute_output --regexp '[.*'
if (( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >=3) )); then
assert_test_fail <<'ERR_MSG'
[[ "$output" =~ "invalid regular expression "([^$'\n']+) ]]
assert_test_fail <<ERR_MSG

-- ERROR: refute_output --
invalid regular expression `[.*': Missing ']'
invalid regular expression ${BASH_REMATCH[1]}
--
ERR_MSG
else
Expand Down
5 changes: 3 additions & 2 deletions test/refute_regex.bats
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ ERR_MSG
run refute_regex value '[.*'

if (( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >=3) )); then
assert_test_fail <<'ERR_MSG'
[[ "$output" =~ "invalid regular expression "([^$'\n']+) ]]
assert_test_fail <<ERR_MSG

-- ERROR: refute_regex --
invalid regular expression `[.*': Missing ']'
invalid regular expression ${BASH_REMATCH[1]}
--
ERR_MSG
else
Expand Down
5 changes: 3 additions & 2 deletions test/refute_stderr.bats
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,11 @@ ERR_MSG
run refute_stderr --regexp '[.*'

if (( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >=3) )); then
assert_test_fail <<'ERR_MSG'
[[ "$output" =~ "invalid regular expression "([^$'\n']+) ]]
assert_test_fail <<ERR_MSG

-- ERROR: refute_stderr --
invalid regular expression `[.*': Missing ']'
invalid regular expression ${BASH_REMATCH[1]}
--
ERR_MSG
else
Expand Down
5 changes: 3 additions & 2 deletions test/refute_stderr_line.bats
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,11 @@ ERR_MSG
run refute_stderr_line --regexp '[.*'

if (( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >=3) )); then
assert_test_fail <<"ERR_MSG"
[[ "$output" =~ "invalid regular expression "([^$'\n']+) ]]
assert_test_fail <<ERR_MSG

-- ERROR: refute_stderr_line --
invalid regular expression `[.*': Missing ']'
invalid regular expression ${BASH_REMATCH[1]}
--
ERR_MSG
else
Expand Down