You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor the `refute_line` function to handle both output and
stderr streams uniformly. Introduce a new helper function
`__refute_stream_line` to streamline the logic and reduce
code duplication.
Introduce the `refute_stderr_line` function to verify that an
unexpected line does not appear in the stderr output. Update
documentation to reflect usage and necessary conditions for correct
operation, including the requirement to use `--separate-stderr`
when running commands.
Copy file name to clipboardExpand all lines: README.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ This project provides the following functions:
40
40
-[assert_line](#assert_line) / [refute_line](#refute_line) Assert a specific line of output does (or does not) contain given content.
41
41
-[assert_regex](#assert_regex) / [refute_regex](#refute_regex) Assert a parameter does (or does not) match given pattern.
42
42
-[assert_stderr](#assert_stderr) / [refute_stderr](#refute_stderr) Assert stderr does (or does not) contain given content.
43
-
-[assert_stderr_line](#assert_stderr_line) Assert a specific line of stderr does contain given content.
43
+
-[assert_stderr_line](#assert_stderr_line)/ [refute_stderr_line](#refute_stderr_line)Assert a specific line of stderr does (or does not) contain given content.
44
44
45
45
These commands are described in more detail below.
46
46
@@ -1007,6 +1007,17 @@ On failure, the same details are displayed as for literal matching, except that
1007
1007
--
1008
1008
```
1009
1009
1010
+
### `refute_stderr_line`
1011
+
1012
+
> _**Note**:
1013
+
> `run` has to be called with `--separate-stderr` to separate stdout and stderr into `$output` and `$stderr`.
1014
+
> If not, `$stderr` will be empty, causing `refute_stderr_line` to always pass.
1015
+
1016
+
Similarly to `refute_stderr`, this function helps to verify that a command or function produces the correct stderr.
1017
+
It checks that the unexpected line does not appear in the stderr (default) or in a specific line of it.
1018
+
Matching can be literal (default), partial or regular expression.
1019
+
This function is the logical complement of `assert_stderr_line`.
0 commit comments