2 # Copyright (C) 2001-2007, The Perl Foundation.
7 use lib qw( . lib ../lib ../../lib );
9 use Parrot::Test tests => 6;
13 t/op/time.t - Time and Sleep
21 Tests the C<time> and C<sleep> operations.
25 pasm_output_is( <<'CODE', <<'OUTPUT', "time_i" );
30 OK1: print "ok, (!= 1970) Grateful Dead not\n"
33 OK2: print "ok, (now>before) timelords need not apply\n"
35 FAIL: print "failure\n"
44 ok, (!= 1970) Grateful Dead not
45 ok, (now>before) timelords need not apply
48 pasm_output_is( <<'CODE', <<'OUTPUT', "time_n" );
53 OK1: print "ok, (!= 1970) Grateful Dead not\n"
56 OK2: print "ok, (now>before) timelords need not apply\n"
58 FAIL: print "failure\n"
62 ok, (!= 1970) Grateful Dead not
63 ok, (now>before) timelords need not apply
67 skip 'failling on win32' => 1 if $^O =~ m/win32/i;
69 pasm_output_is( <<CODE, <<OUTPUT, "sleep" );
81 print "no, sleeping made time go the wrong way "
93 pasm_error_output_like( <<CODE, <<OUT , "sleep" );
97 /Cannot go back in time/
101 ( undef, undef, undef, undef, undef, $year ) = gmtime(time);
104 # don't run this test 1 tick before the year changes #'
106 pasm_output_is( <<'CODE', $year, "decodelocaltime" );
108 decodelocaltime P0, I0
115 pir_output_is(<<'CODE', "Tue Jan 1 00:00:00 2008\n25", "gmtime string length");
127 # cperl-indent-level: 4
130 # vim: expandtab shiftwidth=4: