projects
/
notmuch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b31c62
)
test: add utility function to sort a json list
author
David Bremner
<david@tethera.net>
Tue, 11 Mar 2014 16:52:19 +0000
(13:52 -0300)
committer
David Bremner
<david@tethera.net>
Tue, 11 Mar 2014 22:22:52 +0000
(19:22 -0300)
So far we only need this one place, but it's a bit messy to inline
test/test-lib.sh
patch
|
blob
|
history
diff --git
a/test/test-lib.sh
b/test/test-lib.sh
index 66edb7c99f244a18b4cbae9a4804a601004a20b5..9824bb67a038c9cee08f4bc5ad481c93c77bd806 100644
(file)
--- a/
test/test-lib.sh
+++ b/
test/test-lib.sh
@@
-622,6
+622,12
@@
test_expect_equal_json () {
test_expect_equal "$output" "$expected" "$@"
}
+# Sort the top-level list of JSON data from stdin.
+test_sort_json () {
+ PYTHONIOENCODING=utf-8 python -c \
+ "import sys, json; json.dump(sorted(json.load(sys.stdin)),sys.stdout)"
+}
+
test_emacs_expect_t () {
test "$#" = 2 && { prereq=$1; shift; } || prereq=
test "$#" = 1 ||