]> git-server-git.apps.pok.os.sepia.ceph.com Git - googletest.git/commitdiff
gmock_output_test: normalize golden file output to unix line endings
authorAbseil Team <absl-team@google.com>
Tue, 17 Jan 2023 15:12:03 +0000 (07:12 -0800)
committerCopybara-Service <copybara-worker@google.com>
Tue, 17 Jan 2023 15:12:50 +0000 (07:12 -0800)
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

googlemock/test/gmock_output_test.py

index 6b4ab9015d0d7fc45dfadf9c9793f44d65659519..d7c3f27e876b661be4c8e204f27544c7839438ab 100755 (executable)
@@ -159,6 +159,9 @@ class GMockOutputTest(gmock_test_utils.TestCase):
     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)