Skip to content

Conversation

@bsod85
Copy link

@bsod85 bsod85 commented Aug 29, 2022

No description provided.

*
* @var string
*/
protected $_split = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove the $_split property?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous implementation saved the target EOL first character in this property. To my understanding this was wrong as we are searching for source EOLs.
My implementation uses the _prependNext property to keep track of a carriage return at the end of a bucket when we are searching for CR+LF EOLs.

public static function lineEndingProvider()
{
return array(
array("\r", "ABCDEFGHI"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two tests got messed up.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the strings to use escaped notation for carriage returns.


public function testUnixStyleNewLineSubstitution()
{
$test = str_repeat(str_repeat("A", 1) . "\r\n", 4000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

str_repeat(...,1) doesn't make much sense.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a left over from the developing phase. Fixed. Thanks

@bsod85 bsod85 force-pushed the fix_new_line_conversion_corner_case branch from af2f761 to 4119618 Compare April 7, 2025 13:25
@bsod85 bsod85 changed the base branch from master to FRAMEWORK_6_0 April 7, 2025 13:25

public function testUnixStyleNewLineSubstitution()
{
$test = str_repeat("A\r\n", 4000);
Copy link
Author

@bsod85 bsod85 Apr 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test string needs to be bigger than a stream bucket and the carriage return needs to be at the end of a bucket

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.

2 participants