diff options
author | David Bremner <david@tethera.net> | 2021-05-15 10:05:07 -0300 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2021-05-22 09:02:58 -0300 |
commit | 349fc2980346db2dba619cda5d9cdf0d943d3053 (patch) | |
tree | 8e79767cba9809ffd090f942c436685b34491839 | |
parent | 892f4e65ae45f86992777a6803f3bbda4c820188 (diff) |
test: add known broken test for duplicate thread-id terms
According to my bijection, this bug has been present since commit
411675a6ce in 2017. It is not completely clear what harm it causes in
regulary use, but it (at least) makes notmuch crash when compiled with
-DDEBUG_DATABASE_SANITY.
-rwxr-xr-x | test/T670-duplicate-mid.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/T670-duplicate-mid.sh b/test/T670-duplicate-mid.sh index 4e5672ab..cf0041b0 100755 --- a/test/T670-duplicate-mid.sh +++ b/test/T670-duplicate-mid.sh @@ -2,10 +2,26 @@ test_description="duplicate message ids" . $(dirname "$0")/test-lib.sh || exit 1 +test_require_external_prereq xapian-delve + add_message '[id]="duplicate"' '[subject]="message 1" [filename]=copy1' add_message '[id]="duplicate"' '[subject]="message 2" [filename]=copy2' add_message '[id]="duplicate"' '[subject]="message 0" [filename]=copy0' + +test_begin_subtest 'at most 1 thread-id per xapian document' +test_subtest_known_broken +db=${MAIL_DIR}/.notmuch/xapian +for doc in $(xapian-delve -1 -t '' "$db" | grep '^[1-9]'); do + xapian-delve -1 -r "$doc" "$db" | grep -c '^G' +done > OUTPUT.raw +sort -u < OUTPUT.raw > OUTPUT +cat <<EOF > EXPECTED +0 +1 +EOF +test_expect_equal_file EXPECTED OUTPUT + test_begin_subtest 'search: first indexed subject preserved' cat <<EOF > EXPECTED thread:XXX 2001-01-05 [1/1(3)] Notmuch Test Suite; message 1 (inbox unread) |