Skip to content

Commit

Permalink
gmock_output_test: normalize golden file output to unix line endings
Browse files Browse the repository at this point in the history
When checked out on Windows, the repo might use \r\n line endings,
and so the golden output has them.  Adjust for that.

PiperOrigin-RevId: 502577222
Change-Id: Iabfe537f6d95a49bf6bdcb934e855d28c65f6f89
  • Loading branch information
Abseil Team authored and copybara-github committed Jan 17, 2023
1 parent 356fc30 commit ac7a126
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions googlemock/test/gmock_output_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ def testOutput(self):
golden_file = open(GOLDEN_PATH, 'rb')
golden = golden_file.read().decode('utf-8')
golden_file.close()
# On Windows the repository might have been checked out with \r\n line
# endings, so normalize it here.
golden = ToUnixLineEnding(golden)

# The normalized output should match the golden file.
self.assertEqual(golden, output)
Expand Down

0 comments on commit ac7a126

Please sign in to comment.