Skip to content

Commit

Permalink
Make update_protos test compatible with Windows
Browse files Browse the repository at this point in the history
The previous variant didn't account for different newline encodings on
Unix and Windows. This wasn't (and still isn't) visible in CI because
the Windows workflow only invokes Cargo tests.
  • Loading branch information
aaronmondal committed Oct 17, 2023
1 parent 93572d1 commit c2e2793
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions proto/update_protos.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def check(proto_packages):
failed = True
print("Could not read package %s: %s" % (pkg, e))
continue
if expected == actual:
# Ignore differences between newlines on Unix and Windows.
if expected.splitlines() == actual.splitlines():
print("%s OK" % dst)
else:
print("%s out of date" % dst)
Expand All @@ -94,7 +95,8 @@ def check(proto_packages):
except OSError as e:
failed = True
print("Could not read package lib.rs: %s" % e)
if expected == actual:
# Ignore differences between newlines on Unix and Windows.
if expected.splitlines() == actual.splitlines():
print("%s OK" % dst)
else:
print("%s out of date" % dst)
Expand Down

0 comments on commit c2e2793

Please sign in to comment.