Skip to content

Conversation

@MatTheCat
Copy link
Contributor

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #58910
License MIT

@fabpot
Copy link
Member

fabpot commented Aug 23, 2025

Thank you @MatTheCat.

@fabpot fabpot merged commit 5c143ba into symfony:6.4 Aug 23, 2025
11 checks passed
@MatTheCat MatTheCat deleted the ticket_58910 branch August 23, 2025 11:28
This was referenced Aug 29, 2025
@DaveLiddament
Copy link

FYI: This update has caused a number of my test to fail (see: DaveLiddament/sarb#152) . All my tests passed again when downgrading just the symfony/console package from 6.4.25 to 6.4.24.

The problem I encountered is the addition of the EOT character (x04) added in TesterTrait::createStream

In order to make my tests pass, I have to add in some code the removes the trailing EOT character (if it exists).

As far as I can tell (my package has been used for 7 years) this character does not exist in real applications.
Therefore I'm wondering if the addition of EOT (in some circumstances) is valid, as it does not appear to map what really happens.

If you want to explore this more, then I can try and put together a small reproducer.

PS: Thanks to all the Symfony team and contributors for creating such an amazing framework.

@MatTheCat
Copy link
Contributor Author

Thanks for the feedback @DaveLiddament, the x04 character was added to emulate the end of a multiline question’s answer and I didn’t even think new lines could appear in other contexts..!

I guess it should be the developer responsibility to add this character then; will open a PR.

nicolas-grekas added a commit that referenced this pull request Sep 8, 2025
… inputs (MatTheCat)

This PR was squashed before being merged into the 6.4 branch.

Discussion
----------

[Console] Don’t automatically append EOT to multiline test inputs

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | N/A
| License       | MIT

#61501 assumed multiline inputs were answers to multiline questions and suffixed them with an EOT character to mark their end.

But if you’re directly reading stdin, you can have line breaks without the need for an EOT: #61501 (comment)

Since the `TesterTrait` doesn’t know the inputs’ context, this PR reverts this behavior. Multiline questions will still be able to be tested by manually suffixing the answer with an EOT (`x04`) like in the added test.

If it is accepted it’ll be followed by a doc PR.

Commits
-------

938fabb [Console] Don’t automatically append EOT to multiline test inputs
nicolas-grekas added a commit that referenced this pull request Sep 8, 2025
…th an EOT (MatTheCat)

This PR was merged into the 6.4 branch.

Discussion
----------

[Console] Don’t append a new line to test inputs ending with an EOT

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | N/A
| License       | MIT

#61501 wrote a new line before multiline test inputs’ EOT character, and #61690 wrote it after… so the next input would always be empty.

This PR doesn’t write a new line if a test input ends with `\x4` so that the stream matches the inputs.

Commits
-------

74ae155 [Console] Don’t append a new line to test inputs ending with an EOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants