Skip to content

Fix InternalProvisionExceptionTest, which was failing on Windows due to a newline assumption#1213

Closed
chrisparton1991 wants to merge 1 commit intogoogle:masterfrom
chrisparton1991:fix-test-failure
Closed

Fix InternalProvisionExceptionTest, which was failing on Windows due to a newline assumption#1213
chrisparton1991 wants to merge 1 commit intogoogle:masterfrom
chrisparton1991:fix-test-failure

Conversation

@chrisparton1991
Copy link
Contributor

InternalProvisionException uses the %n string format, which returns a platform-specific newline code. InternalProvisionExceptionTest, however, assumes a \n, and therefore fails on Windows.

I've updated the unit test to use System.lineSeparator() so the test will pass on any platform.

copybara-service bot pushed a commit that referenced this pull request Apr 19, 2023
…e system line separator and always using \n explicitly. (We were previously inconsistent: many places used \n, and many other places used %n with a formatter, which would end up being the system line separator.) This allows tests to pass on Windows, where the line separator is different. Also update tests to do a run with the windows line separator, to catch regressions. Fixes #1213.

PiperOrigin-RevId: 525552063
copybara-service bot pushed a commit that referenced this pull request Apr 19, 2023
…e system line separator and always using \n explicitly. (We were previously inconsistent: many places used \n, and many other places used %n with a formatter, which would end up being the system line separator.) This allows tests to pass on Windows, where the line separator is different. Also update tests to do a run with the windows line separator, to catch regressions. Fixes #1213.

PiperOrigin-RevId: 525552063
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants