Repository navigation
Fix 'Get-Content -Delimiter' to not include the delimiter in the returned lines - #3808
Conversation
|
Michael Klement (@mklement0), |
Ilya (iSazonov)
left a comment
There was a problem hiding this comment.
Michael Klement (@mklement0) It seems you don't fix "tail".
/cc jeffbi Could you please review?
|
Ilya (@iSazonov) Thanks for catching the |
|
I believe the problem is in platform difference of Newline. |
There was a problem hiding this comment.
Can this be converted to use the -TestCase parameter for It? That would make the test much more readable.
There was a problem hiding this comment.
I didn't write these tests (and the only modification I made was to resolve aliases to their full cmdlet names), but I can look into it.
There was a problem hiding this comment.
Rather than change it here, I suggest we open a new issue to refactor these test cases to use -TestCase
There was a problem hiding this comment.
I filed Issue #3945 to cover this comment.
There was a problem hiding this comment.
Any reason to skip on Linux or OSX?
There was a problem hiding this comment.
Again, I can't speak to these tests, but perhaps BugId(BugDatabase.WindowsOutOfBandReleases, 906022) holds the key?
Separately, if you have any pointers as to why the PR doesn't work on Windows (have yet to dig into it), that would be helpful.
Ilya (@iSazonov) thinks that it may be the difference in newline sequences, though that's not immediately obvious to me.
There was a problem hiding this comment.
unfortunately, I don't know if that bug database even exists anymore. that comment is basically worthless now.
|
Aditya Patwardhan (@adityapatwardhan) I don't see any more outstanding comments. Do you have any additional concerns? |
|
Michael Klement (@mklement0) Please address the failing test: [-] should Get-Content with a variety of -Tail and -ReadCount values 68ms |
|
Mike Richmond (@mirichmo): I'll take a look soon. In the meantime, if you have a high-level pointer as to how the platform-specific newline sequence might come into play here (it works in the Unix world, but not on Windows), please let me know. |
|
Michael Klement (@mklement0) Test failed for Also I see the code is not optimal and we should refactor this in another PR. |
|
Thanks for the tips, Ilya (@iSazonov). |
65c0a5f to
906a276
Compare
|
Note that the only changes to Thanks to Ilya (@iSazonov) for pointing me to what I hope is the right fix, which turned out to be simple in the end. |
There was a problem hiding this comment.
Here we evaluate content.ToString() twice - maybe do this one before block.Add().
|
Michael Klement (@mklement0) Could you please split functional and formatting changes to two commits? This will help us avoid error skipping. |
…lements returned (PowerShell#3706) - functional changes
…lements returned (PowerShell#3706) - formatting changes
906a276 to
c50f3f8
Compare
|
Ilya (@iSazonov): I've made the changes and split them into 2 commits (functional vs. formatting) that replaced the earlier ones. I think the Travis CI failure is a transient one, unrelated to my changes (it got stuck while setting up the environment). Is there a way to re-initiate the test? |
|
Michael Klement (@mklement0) I restarted that job for you |
|
Michael Klement (@mklement0) Tip: You can "rename" last commit to restart CI jobs. |
|
Thanks, Ilya (@iSazonov), but how do you rename a commit? Amend the commit message and push again? |
|
Thanks all! Since we got 2 approvals and Ilya (@iSazonov)'s comments are also addressed, I will rebase and merge this PR soon (in about one hour). Please let me know if there are any concerns. |
|
Michael Klement (@mklement0) Yes, you can amend or rebase+reword. |
Fix #3706