Commit ac7a126f authored by Abseil Team's avatar Abseil Team Committed by Copybara-Service
Browse files

gmock_output_test: normalize golden file output to unix line endings

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
parent 356fc301
...@@ -159,6 +159,9 @@ class GMockOutputTest(gmock_test_utils.TestCase): ...@@ -159,6 +159,9 @@ class GMockOutputTest(gmock_test_utils.TestCase):
golden_file = open(GOLDEN_PATH, 'rb') golden_file = open(GOLDEN_PATH, 'rb')
golden = golden_file.read().decode('utf-8') golden = golden_file.read().decode('utf-8')
golden_file.close() 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. # The normalized output should match the golden file.
self.assertEqual(golden, output) self.assertEqual(golden, output)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment