Skip to content

fix: no undefined index in "output should (not) be:" - #49

Merged
Jean-Beru merged 2 commits into
soyuka:mainfrom
Jean-Beru:Jean-Beru/3.4.2-fix-output-compare
Oct 17, 2026
Merged

Jean-Beru merged 2 commits into
soyuka:mainfrom
Jean-Beru:Jean-Beru/3.4.2-fix-output-compare

Conversation

@Jean-Beru

@Jean-Beru Jean-Beru commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Depends on #48: review only the last commit.

When the command output has more lines than the expected text, output should be: and output should not be: read an undefined index and PHP emits an Undefined array key warning. A missing expected line is now null: the step result and the messages do not change, only the warning goes away.

Given I execute "printf 'a\nb\n'"
Then output should be:
    """
    a
    """

Before: fails with an Undefined array key 1 warning. After: fails with instead of followed by the real output.

The "command should succeed" and "command should fail" steps formatted
the return code with "%b", in binary. For an exit code of 2, the message
was "Command should succeed 10". Use "%d", so that the message is
"Command should succeed 2".

Assisted-by: Claude:claude-opus-5-5
The "output should be:" and "output should not be:" steps read an
undefined index of the expected lines when the output had more lines.
PHP then emitted an "Undefined array key" warning.

A missing expected line is now null, so it differs from the output
line. The step results and the exception messages do not change.

Assisted-by: Claude:claude-opus-5-5
@Jean-Beru
Jean-Beru merged commit 0d0cb2b into soyuka:main Oct 17, 2026
23 checks passed
@Jean-Beru
Jean-Beru deleted the Jean-Beru/3.4.2-fix-output-compare branch October 17, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant