-
Couldn't load subscription status.
- Fork 6
Fix new line conversion corner case #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: FRAMEWORK_6_0
Are you sure you want to change the base?
Fix new line conversion corner case #2
Conversation
| * | ||
| * @var string | ||
| */ | ||
| protected $_split = null; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
test/Horde/Stream/Filter/EolTest.php
Outdated
| public static function lineEndingProvider() | ||
| { | ||
| return array( | ||
| array("\r", "ABCDEFGHI"), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
test/Horde/Stream/Filter/EolTest.php
Outdated
|
|
||
| public function testUnixStyleNewLineSubstitution() | ||
| { | ||
| $test = str_repeat(str_repeat("A", 1) . "\r\n", 4000); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
af2f761 to
4119618
Compare
|
|
||
| public function testUnixStyleNewLineSubstitution() | ||
| { | ||
| $test = str_repeat("A\r\n", 4000); |
There was a problem hiding this comment.
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
No description provided.