Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkarns authored Feb 23, 2023
1 parent caafab6 commit 0beceef
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ refute_line -- '--'

Fail if the given expression evaluates to false.

> _**Note**
> _**Note**:
> The expression must be a simple command.
> [Compound commands][bash-comp-cmd], such as `[[`, can be used only when executed with `bash -c`._
Expand Down Expand Up @@ -294,7 +294,7 @@ An error is displayed when used simultaneously.
Regular expression matching can be enabled with the `--regexp` option (`-e` for short).
When used, the assertion fails if the *extended regular expression* does not match `$output`.

> _**Note**
> _**Note**:
> The anchors `^` and `$` bind to the beginning and the end of the entire output (not individual lines), respectively._
```bash
Expand Down Expand Up @@ -411,7 +411,7 @@ An error is displayed when used simultaneously.
Regular expression matching can be enabled with the `--regexp` option (`-e` for short).
When used, the assertion fails if the *extended regular expression* matches `$output`.

> _**Note**
> _**Note**:
> The anchors `^` and `$` bind to the beginning and the end of the entire output (not individual lines), respectively._
```bash
Expand Down Expand Up @@ -459,8 +459,9 @@ It checks that the expected line appears in the output (default) or in a specifi
Matching can be literal (default), partial or regular expression.
This function is the logical complement of `refute_line`.

***Warning:***
*Due to a [bug in Bats][bats-93], empty lines are discarded from `${lines[@]}`, causing line indices to change and preventing testing for empty lines.*
> _**Warning**:
> Due to a [bug in Bats][bats-93], empty lines are discarded from `${lines[@]}`,
> causing line indices to change and preventing testing for empty lines._
[bats-93]: https://github.com/sstephenson/bats/pull/93

Expand All @@ -478,7 +479,7 @@ The assertion fails if the expected line is not found in `${lines[@]}`.

On failure, the expected line and the output are displayed.

> _**Warning**
> _**Warning**:
> The output displayed does not contain empty lines.
> See the Warning above for more._
Expand Down Expand Up @@ -548,7 +549,7 @@ An error is displayed when used simultaneously.
Regular expression matching can be enabled with the `--regexp` option (`-e` for short).
When used, a match fails if the *extended regular expression* does not match the line being tested.

> _**Note**
> _**Note**:
> As expected, the anchors `^` and `$` bind to the beginning and the end of the matched line, respectively._
```bash
Expand Down Expand Up @@ -581,7 +582,7 @@ It checks that the unexpected line does not appear in the output (default) or in
Matching can be literal (default), partial or regular expression.
This function is the logical complement of `assert_line`.

> _**Warning**
> _**Warning**:
> Due to a [bug in Bats][bats-93], empty lines are discarded from `${lines[@]}`,
> causing line indices to change and preventing testing for empty lines._
Expand All @@ -601,7 +602,7 @@ The assertion fails if the unexpected line is found in `${lines[@]}`.

On failure, the unexpected line, the index of its first match and the output with the matching line highlighted are displayed.

> _**Warning**
> _**Warning**:
> The output displayed does not contain empty lines.
> See the Warning above for more._
Expand Down Expand Up @@ -673,7 +674,7 @@ An error is displayed when used simultaneously.
Regular expression matching can be enabled with the `--regexp` option (`-e` for short).
When used, a match fails if the *extended regular expression* matches the line being tested.

> _**Note**
> _**Note**:
> As expected, the anchors `^` and `$` bind to the beginning and the end of the matched line, respectively._
```bash
Expand Down Expand Up @@ -730,7 +731,7 @@ An error is displayed if the specified extended regular expression is invalid.
For description of the matching behavior, refer to the documentation of the
`=~` operator in the [Bash manual][bash-conditional].

> _**Note**
> _**Note**:
> the `BASH_REMATCH` array is available immediately after the assertion succeeds but is fragile;
> i.e. prone to being overwritten as a side effect of other actions._
Expand Down Expand Up @@ -770,7 +771,7 @@ An error is displayed if the specified extended regular expression is invalid.
For description of the matching behavior, refer to the documentation of the
`=~` operator in the [Bash manual][bash-conditional].

> _**Note**
> _**Note**:
> the `BASH_REMATCH` array is available immediately after the assertion fails but is fragile;
> i.e. prone to being overwritten as a side effect of other actions like calling `run`.
> Thus, it's good practice to avoid using `BASH_REMATCH` in conjunction with `refute_regex()`.
Expand Down

0 comments on commit 0beceef

Please sign in to comment.