From c3cbc327455984af2dd96bff1e1e55a101d1312f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Wed, 18 Dec 2024 10:05:37 +0100 Subject: [PATCH] Checks features are consistent in parsetestrecord --- tools/lint/lib/checks/parsetestrecord.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/lint/lib/checks/parsetestrecord.py b/tools/lint/lib/checks/parsetestrecord.py index d79f324bd0..a4d5360c69 100644 --- a/tools/lint/lib/checks/parsetestrecord.py +++ b/tools/lint/lib/checks/parsetestrecord.py @@ -89,4 +89,14 @@ def run(self, name, meta, source): elif "flags" in test_rec: return "Unexpected flags present in parseTestRecord" + # Ensure all features in `test_rec` are consistent with `meta`. + if "features" in meta: + if "features" not in test_rec: + return "Features not present in parseTestRecord" + + if meta["features"] != test_rec["features"]: + return "Features don't match parseTestRecord" + elif "features" in test_rec: + return "Unexpected features present in parseTestRecord" + return None