summaryrefslogtreecommitdiff
path: root/t/precision.t
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2010-03-08 18:10:57 +0000
committerdakkar <dakkar@thenautilus.net>2010-03-08 18:10:57 +0000
commit86c52699065222d5fcec0d042acd402e8bb57f34 (patch)
tree812b67b501bb682b1bd6bcf32ae181de973ec83b /t/precision.t
parentfirst idea (diff)
downloadDateTime-Format-GeekTime-86c52699065222d5fcec0d042acd402e8bb57f34.tar.gz
DateTime-Format-GeekTime-86c52699065222d5fcec0d042acd402e8bb57f34.tar.bz2
DateTime-Format-GeekTime-86c52699065222d5fcec0d042acd402e8bb57f34.zip
tests, docs, and it works
Diffstat (limited to 't/precision.t')
-rw-r--r--t/precision.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/precision.t b/t/precision.t
new file mode 100644
index 0000000..751e1d6
--- /dev/null
+++ b/t/precision.t
@@ -0,0 +1,18 @@
+#!perl
+use Test::More;
+use DateTime;
+use DateTime::Format::GeekTime;
+
+if ($ENV{SLOW_TESTS}) {
+ plan tests=>65536;
+}
+else {
+ plan skip_all => 'Slow test, set $ENV{SLOW_TESTS} to run it';
+}
+
+for my $i (0..65535) {
+ my $gkt=sprintf '0x%04X on day 0x000',$i;
+ my $dt=DateTime::Format::GeekTime->parse_datetime($gkt);
+ my $round_trip=DateTime::Format::GeekTime->format_datetime($dt);
+ is(substr($round_trip,0,19),$gkt);
+}