Skip to content

🧪 test(serialize): expect LF for a double-escaped CR - #2389

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:test/script-cr-double-escape-expectation
Nov 16, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:test/script-cr-double-escape-expectation

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

A raw-text carriage return has been written as a line feed since #2284, because a re-parse folds a raw CR to LF and reads the same whitespace back. Script text that ends inside a double escape with a CR in it now comes out with an LF, and the second end tag still closes the script. The expected output for those inputs still held the CR, so it no longer matched what the serializer writes. 🔁 Once this merges, the expected output matches the serializer again, and a change to that path shows up as a mismatch.

The serializer still decides how many end tags a script needs by reading its text the way a re-parse would. That decision is unchanged, and only the expected form of the carriage-return inputs moves to the line-feed output that the decision already produces.

Nothing changes for callers of serialize, to_source or encode: their output for these inputs has been the line-feed form on main since #2284.

Fixes #2386

A raw-text CR is written as LF since the serializer folds it (tox-dev#2284), so the
double-escape cases with a CR in the script text now expect the LF form.
@gaborbernat gaborbernat added bug Something isn't working skip news No user-facing changelog entry needed labels Nov 16, 2026
@gaborbernat
gaborbernat merged commit ac4e7e3 into tox-dev:main Nov 16, 2026
2 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working skip news No user-facing changelog entry needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Script double-escape test expects CR, serializer writes LF

1 participant