unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 512559a3aff90086809247e2cb3e8ef0a6451e32 901 bytes (raw)
name: test/T580-thread-search.sh 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 
#!/usr/bin/env bash
#
# Copyright (c) 2015 David Bremner
#

test_description='test of searching by thread-id'

. ./test-lib.sh || exit 1

add_email_corpus

test_begin_subtest "Every message is found in exactly one thread"

count=0
success=0
for id in $(notmuch search --output=messages '*'); do
    count=$((count +1))
    matches=$((`notmuch search --output=threads "$id" | wc -l`))
    if [ "$matches" = 1 ]; then
	success=$((success + 1))
    fi
done

test_expect_equal "$count" "$success"

test_begin_subtest "roundtripping message-ids via thread-ids"

count=0
success=0
for id in $(notmuch search --output=messages '*'); do
    count=$((count +1))
    thread=$(notmuch search --output=threads "$id")
    matched=$(notmuch search --output=messages "$thread" | grep "$id")
    if [ "$matched" = "$id" ]; then
	success=$((success + 1))
    fi
done

test_expect_equal "$count" "$success"


test_done

debug log:

solving 512559a3aff9 ...
found 512559a3aff9 in https://yhetil.org/notmuch.git/

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).