in reply to Test::More bug?

Your tests and your data to test don't match up. With a few changes this runs fine for me.

#!/usr/bin/perl -w use strict; use Test::More tests => 8; use Date::ICal; my $ical = Date::ICal->new( year => 1964, month => 10, day => 6, hour => 6, min => 12, sec => 47, tz => '0530' ); ok( defined $ical, 'new() returned something' ); ok( $ical->isa('Date::ICal'), " and it's the right class" ); is( $ical->sec , 47, ' sec()' ); is( $ical->min , 12, ' min()' ); is( $ical->hour , 12, ' hour()' ); #changed to 12 is( $ical->day , 6, ' day()' ); #changed to 6 is( $ical->month , 10, ' month()' ); is( $ical->year , 1964, ' year()' );


Of Course your tz may be different from mine (and that of the author of the module) which would seem to explain the first error you got.

use Your::Head;

Replies are listed 'Best First'.
Re: Re: Test::More bug?
by jens (Pilgrim) on Aug 30, 2002 at 06:05 UTC
    Your tests and your data to test don't match up. With a few changes this runs fine for me.

    Yes, that was the idea!

    I'm expecting it to say:"test failed: got 6"
    but instead it says "20" and "5"!
    Also, when all the values match up as they should, I still get an error. When I try cutting and pasting the precise example from 'perldoc Test::Tutorial', my actual and tested values for hour are '16' but it says it actually "got 6".!!

    use Your::Eyes;
      I'm expecting it to say:"test failed: got 6"
      but instead it says "20" and "5"!


      20 is the line number and 5 is the test number that failed.

      When I try cutting and pasting the precise example from 'perldoc Test::Tutorial', my actual and tested values for hour are '16' but it says it actually "got 6"

      Like I said last time I think this is because your timezone is different from the author's. If I am wrong hopefully someone will clear that up.

      use Your::Eyes;

      I did, but they were tired and kept trying to close on me. Seriously though my "use Your::Head;" is merely my sig and wasn't an insult nor was it directed at you. I also think that it is a little silly to downvote some of my very old nodes over this.

      use Your::Head;