glsl/tests: Use splitlines() instead of strip()
strip() removes leading and trailing newlines, but leaves newlines between multiple lines in the string. This could cause failures when comparing the output of cross-compiled Windows binaries (producing Windows-style newlines) to the expected output with Unix-style newlines. Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
This commit is contained in:

committed by
Michel Dänzer

parent
96aef08dc6
commit
f6a913bb95
@@ -65,11 +65,11 @@ def main():
|
|||||||
file = os.path.join(args.test_directory, file)
|
file = os.path.join(args.test_directory, file)
|
||||||
|
|
||||||
with open('{}.expected'.format(file), 'rb') as f:
|
with open('{}.expected'.format(file), 'rb') as f:
|
||||||
expected = f.read().strip()
|
expected = f.read().splitlines()
|
||||||
|
|
||||||
actual = subprocess.check_output(
|
actual = subprocess.check_output(
|
||||||
runner + ['--just-log', '--version', '150', file]
|
runner + ['--just-log', '--version', '150', file]
|
||||||
).strip()
|
).splitlines()
|
||||||
|
|
||||||
if actual == expected:
|
if actual == expected:
|
||||||
print('PASS')
|
print('PASS')
|
||||||
|
Reference in New Issue
Block a user