GeezerVison is showing github.com — [MSHARED-952] make PrettyPrintXmlWriter platform independent by elharo · Pull Request #62 · apache/maven-shared-utils
Conversation
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Isn't the test portable already when the proper line separator is used throughout?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
It passes on all platforms ATM but it's not testing the same thing on all platforms. E.g. if we had a bug in handling \r\n then the bug wouldn't be seen when running on Linux or the Mac. Or if we had a bug handing \n it wouldn't be found on Windows.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
But the purpose of the test is to test the tags and not the line separators? You have removed unifyLineSeparators() which makes it better.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The general contract of a unit test is running a function with known, fixed input and comparing it to known fixed output. unifyLineSeparators() means the input and output to which its applied are no longer fixed. They're platform dependent. While we do occasionally need tests for specific issues that crop up on this or that platform, there's no need for it here.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
elharo
commented
Aug 15, 2020
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
Fixing this has revealed some more platform dependent code in our output code which interferes with reproducible builds.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
elharo
changed the title
[MSHARED-952] make test platform independent
[MSHARED-952] make PrettyPrinXmlWriter platform independent
Aug 16, 2020
elharo
changed the title
[MSHARED-952] make PrettyPrinXmlWriter platform independent
[MSHARED-952] make PrettyPrintXmlWriter platform independent
Aug 16, 2020
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.