From 388b017bdc4e288542ad57cd73728fd2ac8ef7d3 Mon Sep 17 00:00:00 2001 From: Tobias Leich Date: Fri, 31 Aug 2012 12:54:09 +0300 Subject: [PATCH] time returns Num instead of Int (like niecza) --- S32-temporal/DateTime.t | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/S32-temporal/DateTime.t b/S32-temporal/DateTime.t index 948b35ff31..2c538c6ea4 100644 --- a/S32-temporal/DateTime.t +++ b/S32-temporal/DateTime.t @@ -21,7 +21,8 @@ sub show-dt($dt) { } # An independent calculation to cross check the Temporal algorithms. -sub test-gmtime( Int $t is copy ) { +multi sub test-gmtime( Num $t ) { test-gmtime( $t.Int ) } +multi sub test-gmtime( Int $t is copy ) { my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday); $sec = $t % 60; $t div= 60; # $t is now epoch minutes $min = $t % 60; $t div= 60; # $t is now epoch hours @@ -50,7 +51,7 @@ sub test-gmtime( Int $t is copy ) { # L> # -------------------------------------------------------------------- -isa_ok time, Int, 'time returns an Int'; +isa_ok time, Num, 'time returns a Num'; # -------------------------------------------------------------------- # L/immutable> @@ -270,7 +271,7 @@ is DateTime.new('2009-12-31T22:33:44', $dt = dt year => @t[5], month => @t[4], day => @t[3], hour => @t[2], minute => @t[1], second => @t[0]; - is $dt.posix, $t, "at $dt, POSIX is {$dt.posix}"; + is $dt.posix, $t.Int, "at $dt, POSIX is {$dt.posix}"; } # --------------------------------------------------------------------