From 03839a8110054c51b406a7ce96fa532a72476466 Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins Date: Mon, 27 May 2019 18:35:10 +0000 Subject: [PATCH] test: new test framework to compare json parts This makes it easier to write fairly compact, readable tests of json output, without needing to sanitize away parts that we don't care about. Signed-off-by: Daniel Kahn Gillmor --- test/json_check_nodes.py | 114 +++++++++++++++++++++++++++++++++++++++ test/test-lib.sh | 24 +++++++++ 2 files changed, 138 insertions(+) create mode 100755 test/json_check_nodes.py diff --git a/test/json_check_nodes.py b/test/json_check_nodes.py new file mode 100755 index 00000000..17403c57 --- /dev/null +++ b/test/json_check_nodes.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python +import re +import sys +import json + + +EXPR_RE = re.compile('(?P