X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test%2Ftest-lib.sh;h=66edb7c99f244a18b4cbae9a4804a601004a20b5;hb=e79d2fc993dcd6fb328c31b2a0466cf7413a8276;hp=9222689d5199bf78774ca8ae80367ded6a87b520;hpb=d8ba7bee7d3dd3b7b47c7bfd96434effef7227f0;p=notmuch diff --git a/test/test-lib.sh b/test/test-lib.sh index 9222689d..66edb7c9 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -374,8 +374,12 @@ generate_message () # 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))) + local date_secs=$((978709437 - gen_msg_cnt)) + # printf %(..)T is bash 4.2+ feature. use perl fallback if needed... + TZ=UTC printf -v template[date] "%(%a, %d %b %Y %T %z)T" $date_secs 2>/dev/null || + template[date]=`perl -le 'use POSIX "strftime"; + @time = gmtime '"$date_secs"'; + print strftime "%a, %d %b %Y %T +0000", @time'` fi additional_headers=""