forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev-perl/DateTime-Tiny: Fix test bug w/ new DateTime::Locale
See https://rt.cpan.org/Public/Bug/Display.html?id=108636 Only affects tests. Package-Manager: portage-2.2.27
- Loading branch information
1 parent
d56e500
commit 1f4d88f
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
From b03f13d762d577a3f4774c0ed64b8d376c74da9a Mon Sep 17 00:00:00 2001 | ||
From: Nigel Gregoire <[email protected]> | ||
Date: Mon, 11 Jan 2016 12:00:06 -0800 | ||
Subject: [PATCH] Fix locale test for newer DateTime::Locale | ||
|
||
As of v1.00, DateTime::Locale uses "en-US-POSIX" instead of "C". | ||
--- | ||
t/02_main.t | 6 +++++- | ||
1 file changed, 5 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/t/02_main.t b/t/02_main.t | ||
index 18bd8d1..6c2b371 100644 | ||
--- a/t/02_main.t | ||
+++ b/t/02_main.t | ||
@@ -10,6 +10,7 @@ BEGIN { | ||
|
||
use Test::More tests => 31; | ||
use DateTime::Tiny; | ||
+use version 0.77; | ||
|
||
|
||
|
||
@@ -76,7 +77,10 @@ SKIP: { | ||
# Expand to a DateTime | ||
my $dt = $date->DateTime; | ||
isa_ok( $dt, 'DateTime' ); | ||
- is( $dt->locale->id, 'C', '->locate ok' ); | ||
+ # DateTime::Locale version 1.00 changes "C" to "en-US-POSIX". | ||
+ my $expected = version->parse($DateTime::Locale::VERSION) < version->parse("1.00") | ||
+ ? "C" : "en-US-POSIX"; | ||
+ is( $dt->locale->id, $expected, '->locale ok' ); | ||
is( $dt->time_zone->name, 'floating', '->timezone ok' ); | ||
|
||
# Compare accessor results |