From: David Bremner <david@tethera.net>
To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org
Subject: Re: [PATCH] test: Test thread linking in all possible delivery orders
Date: Mon, 07 Apr 2014 07:37:48 -0300 [thread overview]
Message-ID: <87y4zhfmrn.fsf@maritornes.cs.unb.ca> (raw)
In-Reply-To: <1395608456-9673-1-git-send-email-amdragon@mit.edu>
Austin Clements <amdragon@MIT.EDU> writes:
> +THREADS=$(python -c '
> +def mkTrees(free, tree={}):
> + if not free:
I'm not sure if using not for an empty set is idiomatic python or not,
but it did confuse me a moment.
> + print(" ".join(map(str, [msg[1] for msg in sorted(tree.items())])))
> + return
> + # Attach each free message to each message in the tree (if there is
> + # no tree, make the free message the root)
> + for msg in sorted(free):
> + parents = sorted(tree.keys()) if tree else ["none"]
> + for parent in parents:
> + ntree = tree.copy()
> + ntree[msg] = parent
> + mkTrees(free - set([msg]), ntree)
> +mkTrees(set(range(4)))')
FWIW, it took me a while to understand this. I might have twigged
faster if the initial comment said something like "via backtracking".
> +output=$(notmuch search '*' | notmuch_search_sanitize)
> +expected=$(for ((i = 0; i < $nthreads; i++)); do
> + echo "thread:XXX 2001-01-05 [4/4] m3, m2, m1, m0; p$i (inbox unread)"
> + done)
> +test_expect_equal "$output" "$expected"
It seems to me this summary line depends on the default search order.
It might be worth specifying the search order in the "notmuch search"
command just to make it a bit more robust.
d
next prev parent reply other threads:[~2014-04-07 10:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-23 21:00 [PATCH] test: Test thread linking in all possible delivery orders Austin Clements
2014-04-07 10:37 ` David Bremner [this message]
2014-04-21 19:58 ` [PATCH v2] " Austin Clements
2014-04-22 21:31 ` Mark Walters
2014-04-22 22:11 ` Austin Clements
2014-07-09 21:15 ` [PATCH v3] " Austin Clements
2014-07-16 10:31 ` David Bremner
2014-07-16 22:35 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y4zhfmrn.fsf@maritornes.cs.unb.ca \
--to=david@tethera.net \
--cc=amdragon@MIT.EDU \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).