]> git.notmuchmail.org Git - notmuch/commitdiff
test: give unique timestamps to messages
authorDavid Bremner <david@tethera.net>
Sun, 8 Dec 2013 15:29:38 +0000 (23:29 +0800)
committerDavid Bremner <david@tethera.net>
Mon, 9 Dec 2013 13:20:28 +0000 (21:20 +0800)
The choice of decreasing timestamps is a hack which reduces the number
of existing tests which fail.  This can be changed to increasing
if/when somebody wants update another 47 tests.

test/excludes
test/test-lib.sh

index f1ae9ea96c9ad2d1278312aa31bfa722f6607346..8bbbc2dd033700119bc6768264940eab821b0d06 100755 (executable)
@@ -67,7 +67,7 @@ thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (deleted inb
 test_begin_subtest "Search, don't exclude \"deleted\" messages when --exclude=flag specified"
 output=$(notmuch search --exclude=flag subject:deleted | notmuch_search_sanitize)
 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)
-thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (deleted inbox unread)"
+thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Deleted (deleted inbox unread)"
 
 test_begin_subtest "Search, don't exclude \"deleted\" messages from search if not configured"
 notmuch config set search.exclude_tags
@@ -152,7 +152,7 @@ ${matching_message_ids[5]}"
 test_begin_subtest "Search, exclude=flag (thread summary)"
 output=$(notmuch search --exclude=flag tag:test | notmuch_search_sanitize)
 test_expect_equal "$output" "thread:XXX   2001-01-05 [0/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread)
-thread:XXX   2001-01-05 [0/6] Notmuch Test Suite; All messages excluded: double match: reply 4 (deleted inbox test unread)
+thread:XXX   2001-01-05 [0/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread)
 thread:XXX   2001-01-05 [0/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread)
 thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single non-excluded match: reply 4 (deleted inbox test unread)
 thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; No messages excluded: single match: reply 3 (inbox test unread)"
index d22408d8135bfd954c984830b104bdc1160e4de6..53cb9475ad0f62cb442efb95cac75fda0a4ee235 100644 (file)
@@ -356,7 +356,11 @@ generate_message ()
     fi
 
     if [ -z "${template[date]}" ]; then
-       template[date]="Fri, 05 Jan 2001 15:43:57 +0000"
+       # we use decreasing timestamps here for historical reasons;
+       # the existing test suite when we converted to unique timestamps just
+       # happened to have signicantly fewer failures with that choice.
+       template[date]=$(TZ=UTC printf "%(%a, %d %b %Y %T %z)T\n" \
+                       $((978709437 - gen_msg_cnt)))
     fi
 
     additional_headers=""