3 # Copyright (c) 2015 David Bremner
6 test_description='test of searching by thread-id'
8 . ./test-lib.sh || exit 1
12 test_begin_subtest "Every message is found in exactly one thread"
16 for id in $(notmuch search --output=messages '*'); do
18 matches=$(notmuch search --output=threads "$id" | wc -l)
19 if [ "$matches" = 1 ]; then
20 success=$((success + 1))
24 test_expect_equal "$count" "$success"
26 test_begin_subtest "roundtripping message-ids via thread-ids"
30 for id in $(notmuch search --output=messages '*'); do
32 thread=$(notmuch search --output=threads "$id")
33 matched=$(notmuch search --output=messages "$thread" | grep "$id")
34 if [ "$matched" = "$id" ]; then
35 success=$((success + 1))
39 test_expect_equal "$count" "$success"