mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
test: sort the output of the "prefix" test in T610-message-property
This test extracts values from a (key,value) map where multiple entries can have the same key, and the entries are sorted by key, but not by value. The test incorrectly assumes that the values will be sorted as well, so sort the output.
This commit is contained in:
parent
00cdfe1071
commit
7b756d1e38
1 changed files with 12 additions and 0 deletions
|
@ -186,6 +186,18 @@ EXPECT0(notmuch_message_add_property (message, "testkey3", "testvalue3"));
|
|||
EXPECT0(notmuch_message_add_property (message, "testkey3", "alice3"));
|
||||
print_properties (message, "testkey", FALSE);
|
||||
EOF
|
||||
# expected: 4 values for testkey1, 3 values for testkey3
|
||||
# they are not guaranteed to be sorted, so sort them, leaving the first
|
||||
# line '== stdout ==' and the end ('== stderr ==' and whatever error
|
||||
# may have been printed) alone
|
||||
mv OUTPUT unsorted_OUTPUT
|
||||
awk ' NR == 1 { print; next } \
|
||||
NR < 6 { print | "sort"; next } \
|
||||
NR == 6 { close("sort") } \
|
||||
NR < 9 { print | "sort"; next } \
|
||||
NR == 9 { close("sort") } \
|
||||
{ print }' unsorted_OUTPUT > OUTPUT
|
||||
rm unsorted_OUTPUT
|
||||
cat <<'EOF' >EXPECTED
|
||||
== stdout ==
|
||||
alice
|
||||
|
|
Loading…
Reference in a new issue