Created
June 30, 2016 13:13
-
-
Save worldmind/70ad0f0a6d52949f4b0932b77bbd13d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use strict; | |
use Test::More tests => 7; | |
BEGIN { | |
use_ok('Class::Date', 'date'); | |
} | |
my $dt0 = date '2016-06-30 12:00'; | |
my $dt1 = date '2016-06-30 12:00'; | |
my $dt2 = date '2016-06-30 12:12'; | |
my $dt3 = date '2016-06-30 12:22'; | |
my $duration = $dt2 - $dt1; | |
ok($dt0 == $dt1, '=='); | |
ok($dt2 > $dt1, '>'); | |
ok($dt1 < $dt2, '<'); | |
ok($dt2 - $dt1 == $duration, '== duration'); | |
ok($dt3 - $dt1 > $duration, '> duration'); | |
ok($dt2 - $duration == $dt1, 'anti duration'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment