mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-28 21:54:10 +01:00
test: add utility function to sort a json list
So far we only need this one place, but it's a bit messy to inline
This commit is contained in:
parent
9b31c62680
commit
8c37821a0d
1 changed files with 6 additions and 0 deletions
|
@ -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 ||
|
||||
|
|
Loading…
Reference in a new issue