From 5a6dc895f227182ab97009967e5e1678f9750555 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Thu, 21 Nov 2019 16:48:07 +0100 Subject: [PATCH] Simplify expression normalization No need to split lines, or remove whitespace after removing whitespace. No behavior change. --- tests/scripts/test_psa_constant_names.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/scripts/test_psa_constant_names.py b/tests/scripts/test_psa_constant_names.py index 4a32851e41..73b67ca01d 100755 --- a/tests/scripts/test_psa_constant_names.py +++ b/tests/scripts/test_psa_constant_names.py @@ -307,8 +307,7 @@ def normalize(expr): """Normalize the C expression so as not to care about trivial differences. Currently "trivial differences" means whitespace. """ - expr = re.sub(NORMALIZE_STRIP_RE, '', expr, len(expr)) - return expr.strip().split('\n') + return re.sub(NORMALIZE_STRIP_RE, '', expr) def do_test(options, inputs, type_word, names): """Test psa_constant_names for the specified type.