File: y2k20.patch

package info (click to toggle)
libperl4-corelibs-perl 0.004-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 368 kB
  • sloc: perl: 2,549; makefile: 2
file content (38 lines) | stat: -rw-r--r-- 1,290 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Description: turn the y2k20 into a y2k40 problem, or fix test failures starting in 2020
 t/timelocal.t fails with
	not ok 31 - timelocal year for 1970 1 2 0 0 0
	#   Failed test 'timelocal year for 1970 1 2 0 0 0'
	#   at t/timelocal.t line 36.
	#          got: '170'
	#     expected: '70'
	not ok 37 - timegm year for 1970 1 2 0 0 0
	#   Failed test 'timegm year for 1970 1 2 0 0 0'
	#   at t/timelocal.t line 49.
	#          got: '170'
	#     expected: '70'
Origin: vendor
Author: gregor herrmann <gregoa@debian.org>
Last-Update: 2020-01-03
Forwarded: https://rt.cpan.org/Ticket/Display.html?id=131341
Bug: https://rt.cpan.org/Ticket/Display.html?id=131341

--- a/t/timelocal.t
+++ b/t/timelocal.t
@@ -25,7 +25,7 @@
 
 	# Test timelocal()
 	{
-		my $year_in = $year < 70 ? $year + 1900 : $year;
+		my $year_in = $year < 90 ? $year + 1900 : $year;
 		my $time = &timelocal($sec,$min,$hour,$mday,$mon,$year_in);
 		my($s,$m,$h,$D,$M,$Y) = localtime($time);
 		is $s, $sec, "timelocal second for @$_";
@@ -38,7 +38,7 @@
 
 	# Test timegm()
 	{
-		my $year_in = $year < 70 ? $year + 1900 : $year;
+		my $year_in = $year < 90 ? $year + 1900 : $year;
 		my $time = &timegm($sec,$min,$hour,$mday,$mon,$year_in);
 		my($s,$m,$h,$D,$M,$Y) = gmtime($time);
 		is $s, $sec, "timegm second for @$_";