From e60ca32af6f4dac7506d23fc2512a0c696f48aa6 Mon Sep 17 00:00:00 2001 From: Buddy Burden Date: Thu, 14 Apr 2016 20:22:16 -0700 Subject: [PATCH] adding release tests to try to parse a simple date in all timezones --- Changes | 2 ++ dist.ini | 2 ++ xt/release/timezones.t | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 xt/release/timezones.t diff --git a/Changes b/Changes index 4424795..fdcfcc5 100644 --- a/Changes +++ b/Changes @@ -8,6 +8,8 @@ Revision history for Date-Easy [Distro Fixes] * Incorrect issues link fixed + * Added author test for parsing dates in all timezones + (should provide better test coverage on release) * Marked bogusly failing datetime test as TODO (see also: https://github.com/muir/Time-modules/issues/8) diff --git a/dist.ini b/dist.ini index 8e7aea0..87eddbc 100644 --- a/dist.ini +++ b/dist.ini @@ -6,6 +6,8 @@ copyright_holder = Buddy Burden version = 0.01 [@BAREFOOT] +[ExtraTests] + [Prereqs] Time::Piece = 1.30 Date::Parse = 1.17 diff --git a/xt/release/timezones.t b/xt/release/timezones.t new file mode 100644 index 0000000..2fa9f3e --- /dev/null +++ b/xt/release/timezones.t @@ -0,0 +1,18 @@ +use Test::Most 0.25; + +use Date::Easy; + + +my $zoneinfo = "/usr/share/zoneinfo"; +die("can't find timezone files to test with!") unless -d $zoneinfo; + +foreach (`find $zoneinfo -type f`) +{ + chomp; + s{^$zoneinfo/}{}; + $ENV{TZ} = $_; + is date("04/95 00:22:12 PDT")->strftime('%Y-%m-%d'), '1995-04-01', "simple parse in timezone: $_"; +} + + +done_testing;