X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2Ftest-lib.sh;h=53cb9475ad0f62cb442efb95cac75fda0a4ee235;hb=b421f00a05dba82d6c3df6dcb6ae9063c5395b49;hp=8f18e735e5aee10262f5b5487d99e05f25ad260e;hpb=18921be2e9c0b15c7a4c053718470f667fd35b35;p=notmuch diff --git a/test/test-lib.sh b/test/test-lib.sh index 8f18e735..53cb9475 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -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="" @@ -618,7 +622,8 @@ notmuch_show_sanitize_all () { sed \ -e 's| filename:.*| filename:XXXXX|' \ - -e 's| id:[^ ]* | id:XXXXX |' + -e 's| id:[^ ]* | id:XXXXX |' | \ + notmuch_date_sanitize } notmuch_json_show_sanitize () @@ -641,6 +646,12 @@ notmuch_emacs_error_sanitize () -e 's/^\[.*\]$/[XXX]/' \ -e "s|^\(command: \)\{0,1\}/.*/$command|\1YYY/$command|" } + +notmuch_date_sanitize () +{ + sed \ + -e 's/^Date: Fri, 05 Jan 2001 .*0000/Date: GENERATED_DATE/' +} # End of notmuch helper functions # Use test_set_prereq to tell that a particular prerequisite is available.