Tests: sink.text.pretty: Add unit tests for enum fields printing
[babeltrace.git] / tests / utils / python / split_sort_compare.py
diff --git a/tests/utils/python/split_sort_compare.py b/tests/utils/python/split_sort_compare.py
new file mode 100644 (file)
index 0000000..3b4f83d
--- /dev/null
@@ -0,0 +1,24 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (C) 2020 Francis Deslauriers <francis.deslauriers@efficios.com>
+
+import sys
+import re
+
+
+def main():
+    expected = sys.argv[1]
+    actual = sys.argv[2]
+    sorted_expected = ''.join(sorted(re.findall(r'\w+|\W+', expected.strip())))
+    sorted_actual = ''.join(sorted(re.findall(r'\w+|\W+', actual.strip())))
+
+    if sorted_expected == sorted_actual:
+        status = 0
+    else:
+        status = 1
+
+    sys.exit(status)
+
+
+if __name__ == '__main__':
+    main()
This page took 0.023504 seconds and 4 git commands to generate.