Skip to content

Commit 95e8de9

Browse files
committed
Compare JSON in codesize
1 parent 1168c8f commit 95e8de9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/test_other.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11955,16 +11955,19 @@ def update_and_print_diff(key, actual, expected):
1195511955

1195611956
obtained_results.update(metadata)
1195711957

11958+
obtained_results_json = json.dumps(obtained_results, indent=2)
11959+
expected_results_json = json.dumps(expected_results, indent=2)
11960+
1195811961
if common.EMTEST_REBASELINE:
11959-
create_file(results_file, json.dumps(obtained_results, indent=2) + '\n', absolute=True)
11962+
create_file(results_file, obtained_results_json + '\n', absolute=True)
1196011963
else:
1196111964
if total_output_size > total_expected_size:
1196211965
print(f'Oops, overall generated code size regressed by {total_output_size - total_expected_size} bytes!')
1196311966
print('If this is expected, rerun the test with --rebaseline to update the expected sizes')
1196411967
if total_output_size < total_expected_size:
1196511968
print(f'Hey amazing, overall generated code size was improved by {total_expected_size - total_output_size} bytes!')
1196611969
print('If this is expected, rerun the test with --rebaseline to update the expected sizes')
11967-
self.assertEqual(obtained_results, expected_results)
11970+
self.assertTextDataIdentical(obtained_results_json, expected_results_json)
1196811971

1196911972
# Tests the library_c_preprocessor.js functionality.
1197011973
@crossplatform

0 commit comments

Comments
 (0)