On Wed, 29 Apr 2015 16:53:16 +0200 Fred de Brouwer <brouwerfd...@xs4all.nl> wrote:
> It might be worthwhile to check the POSIX strftime Clib-function: Yes. And here's the proposed test... far more sane than before if you consider overriding Perl built-in functions to be "sane" :) Oh, and the reason we don't use the POSIX module in MIMEDefang is that it's rather large, so we'd like to avoid pulling it in if the filter doesn't need it. Regards, Dianne. use POSIX; sub rfc2822_date_works : Test(1) { my $now = time(); no warnings 'redefine'; no warnings 'once'; local *time = sub { return $now; }; my $want = strftime('%a, %d %b %Y %H:%M:%S %z', localtime($now)); is(::main::rfc2822_date(), $want, 'Got correct RFC 2822 date'); } _______________________________________________ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com http://lists.roaringpenguin.com/mailman/listinfo/mimedefang