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
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)