Permalink
Browse files

added tests

  • Loading branch information...
rkitover committed Jun 13, 2009
1 parent 9b27e51 commit 9587120b11197caa4db3204aef8d6407cd994a4e
Showing with 23 additions and 0 deletions.
  1. +1 −0 Makefile.PL
  2. +22 −0 t/basic.t
View
@@ -7,6 +7,7 @@ license 'perl';
test_requires 'Test::More';
+requires 'DateTime';
requires 'DateTime::Format::Strptime';
auto_provides;
View
@@ -0,0 +1,22 @@
+use strict;
+use warnings;
+use DateTime::Format::Sybase;
+
+use Test::More tests => 10;
+
+ok((my $dt = DateTime::Format::Sybase->parse_datetime(
+ '2004-08-21T14:36:48.080Z'
+)), 'parsed datetime');
+
+is $dt->year, 2004, 'year';
+is $dt->month, 8, 'month';
+is $dt->day, 21, 'day';
+is $dt->hour, 14, 'hour';
+is $dt->minute, 36, 'minute';
+is $dt->second, 48, 'second';
+is $dt->millisecond, 80, 'millisecond';
+
+ok((my $formatted = DateTime::Format::Sybase->format_datetime($dt)),
+ 'formatted datetime');
+
+is $formatted, '08/21/2004 14:36:48.080', 'formatted datetime correctly';

0 comments on commit 9587120

Please sign in to comment.