]> iEval git - app-lastmsg.git/blobdiff - t/App-Lastmsg.t
Make tests pass on systems without %s strftime specifier
[app-lastmsg.git] / t / App-Lastmsg.t
index a5eca2977adcb7482101671212b9908319279380..a9845098fc2e2632775d2d4e4251917ba8a20034 100644 (file)
@@ -5,14 +5,9 @@ use warnings;
 use Test::More tests => 2;
 BEGIN { use_ok('App::Lastmsg') };
 
-my $real_strftime = \&POSIX::strftime;
-
 {
        no warnings 'redefine';
-       *POSIX::strftime = sub {
-               my ($format, @rest) = @_;
-               $real_strftime->('%s', @rest)
-       };
+       *App::Lastmsg::format_time = sub { shift };
 }
 
 chdir 't';
@@ -23,7 +18,7 @@ $0 = 'lastmsg';
 App::Lastmsg::run;
 
 is $out, <<'EOF', 'output is correct';
-user2 user2@example.org Sat 31 Dec 2016 13:10:00 EET
-user1 user1@example.com Fri 30 Dec 2016 15:44:00 EET
+user2 user2@example.org 1483182600
+user1 user1@example.com 1483105440
 user3                   NOT FOUND
 EOF
This page took 0.020741 seconds and 4 git commands to generate.