0 Star 0 Fork 40

Liquor/perl

forked from src-openEuler/perl 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Fix-time-local-tests-in-2020.patch 2.18 KB
一键复制 编辑 原始数据 按行查看 历史
syyhao 提交于 2020-01-07 12:06 . delete redundant files
From 836390962709d5856816807f13a3edfd4aff1fe1 Mon Sep 17 00:00:00 2001
From: openEuler Buildteam <buildteam@openeuler.org>
Date: Fri, 3 Jan 2020 15:31:48 +0800
Subject: [PATCH] Fix time local tests in 2020
See details at here:https://rt.cpan.org/Public/Bug/Display.html?id=124787
---
cpan/Time-Local/t/Local.t | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/cpan/Time-Local/t/Local.t b/cpan/Time-Local/t/Local.t
index 6341396..e28c6d2 100644
--- a/cpan/Time-Local/t/Local.t
+++ b/cpan/Time-Local/t/Local.t
@@ -96,7 +96,7 @@ SKIP: {
# Test timelocal()
{
- my $year_in = $year < 70 ? $year + 1900 : $year;
+ my $year_in = $year + 1900;
my $time = timelocal( $sec, $min, $hour, $mday, $mon, $year_in );
my ( $s, $m, $h, $D, $M, $Y ) = localtime($time);
@@ -111,7 +111,7 @@ SKIP: {
# Test timegm()
{
- my $year_in = $year < 70 ? $year + 1900 : $year;
+ my $year_in = $year + 1900;
my $time = timegm( $sec, $min, $hour, $mday, $mon, $year_in );
my ( $s, $m, $h, $D, $M, $Y ) = gmtime($time);
@@ -128,7 +128,6 @@ SKIP: {
for (@bad_time) {
my ( $year, $mon, $mday, $hour, $min, $sec ) = @$_;
- $year -= 1900;
$mon--;
eval { timegm( $sec, $min, $hour, $mday, $mon, $year ) };
@@ -138,19 +137,19 @@ for (@bad_time) {
{
is(
- timelocal( 0, 0, 1, 1, 0, 90 ) - timelocal( 0, 0, 0, 1, 0, 90 ), 3600,
+ timelocal( 0, 0, 1, 1, 0, 1990 ) - timelocal( 0, 0, 0, 1, 0, 1990 ), 3600,
'one hour difference between two calls to timelocal'
);
is(
- timelocal( 1, 2, 3, 1, 0, 100 ) - timelocal( 1, 2, 3, 31, 11, 99 ),
+ timelocal( 1, 2, 3, 1, 0, 2000 ) - timelocal( 1, 2, 3, 31, 11, 1999 ),
24 * 3600,
'one day difference between two calls to timelocal'
);
# Diff beween Jan 1, 1980 and Mar 1, 1980 = (31 + 29 = 60 days)
is(
- timegm( 0, 0, 0, 1, 2, 80 ) - timegm( 0, 0, 0, 1, 0, 80 ),
+ timegm( 0, 0, 0, 1, 2, 1980 ) - timegm( 0, 0, 0, 1, 0, 1980 ),
60 * 24 * 3600,
'60 day difference between two calls to timegm'
);
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liquor1/perl.git
git@gitee.com:liquor1/perl.git
liquor1
perl
perl
master

搜索帮助