Skip to content

Commit 6624589

Browse files
committed
Compare JSON in codesize
1 parent 220f237 commit 6624589

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
@@ -11969,16 +11969,19 @@ def update_and_print_diff(key, actual, expected):
1196911969

1197011970
obtained_results.update(metadata)
1197111971

11972+
obtained_results_json = json.dumps(obtained_results, indent=2)
11973+
expected_results_json = json.dumps(expected_results, indent=2)
11974+
1197211975
if common.EMTEST_REBASELINE:
11973-
create_file(results_file, json.dumps(obtained_results, indent=2) + '\n', absolute=True)
11976+
create_file(results_file, obtained_results_json + '\n', absolute=True)
1197411977
else:
1197511978
if total_output_size > total_expected_size:
1197611979
print(f'Oops, overall generated code size regressed by {total_output_size - total_expected_size} bytes!')
1197711980
print('If this is expected, rerun the test with --rebaseline to update the expected sizes')
1197811981
if total_output_size < total_expected_size:
1197911982
print(f'Hey amazing, overall generated code size was improved by {total_expected_size - total_output_size} bytes!')
1198011983
print('If this is expected, rerun the test with --rebaseline to update the expected sizes')
11981-
self.assertEqual(obtained_results, expected_results)
11984+
self.assertTextDataIdentical(obtained_results_json, expected_results_json)
1198211985

1198311986
# Tests the library_c_preprocessor.js functionality.
1198411987
@crossplatform

0 commit comments

Comments
 (0)