Skip to content

Commit 563e911

Browse files
terceirosorah
authored andcommitted
Apply upstream patch to fix TZ tests
Closes: #1028890
1 parent 2b5756c commit 563e911

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
From: nagachika <[email protected]>
2+
Date: Fri, 9 Dec 2022 21:11:47 +0900
3+
Subject: Fix for tzdata-2022g
4+
5+
---
6+
test/ruby/test_time_tz.rb | 21 +++++++++++++++------
7+
1 file changed, 15 insertions(+), 6 deletions(-)
8+
9+
diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb
10+
index fdc9e11..6973b02 100644
11+
--- a/test/ruby/test_time_tz.rb
12+
+++ b/test/ruby/test_time_tz.rb
13+
@@ -7,9 +7,9 @@ class TestTimeTZ < Test::Unit::TestCase
14+
has_lisbon_tz = true
15+
force_tz_test = ENV["RUBY_FORCE_TIME_TZ_TEST"] == "yes"
16+
case RUBY_PLATFORM
17+
- when /linux/
18+
+ when /darwin|linux/
19+
force_tz_test = true
20+
- when /darwin|freebsd|openbsd/
21+
+ when /freebsd|openbsd/
22+
has_lisbon_tz = false
23+
force_tz_test = true
24+
end
25+
@@ -95,6 +95,9 @@ class TestTimeTZ < Test::Unit::TestCase
26+
CORRECT_KIRITIMATI_SKIP_1994 = with_tz("Pacific/Kiritimati") {
27+
Time.local(1994, 12, 31, 0, 0, 0).year == 1995
28+
}
29+
+ CORRECT_SINGAPORE_1982 = with_tz("Asia/Singapore") {
30+
+ "2022g" if Time.local(1981, 12, 31, 23, 59, 59).utc_offset == 8*3600
31+
+ }
32+
33+
def time_to_s(t)
34+
t.to_s
35+
@@ -140,9 +143,12 @@ class TestTimeTZ < Test::Unit::TestCase
36+
37+
def test_asia_singapore
38+
with_tz(tz="Asia/Singapore") {
39+
- assert_time_constructor(tz, "1981-12-31 23:59:59 +0730", :local, [1981,12,31,23,59,59])
40+
- assert_time_constructor(tz, "1982-01-01 00:30:00 +0800", :local, [1982,1,1,0,0,0])
41+
- assert_time_constructor(tz, "1982-01-01 00:59:59 +0800", :local, [1982,1,1,0,29,59])
42+
+ assert_time_constructor(tz, "1981-12-31 23:29:59 +0730", :local, [1981,12,31,23,29,59])
43+
+ if CORRECT_SINGAPORE_1982
44+
+ assert_time_constructor(tz, "1982-01-01 00:00:00 +0800", :local, [1981,12,31,23,30,00])
45+
+ assert_time_constructor(tz, "1982-01-01 00:00:00 +0800", :local, [1982,1,1,0,0,0])
46+
+ assert_time_constructor(tz, "1982-01-01 00:29:59 +0800", :local, [1982,1,1,0,29,59])
47+
+ end
48+
assert_time_constructor(tz, "1982-01-01 00:30:00 +0800", :local, [1982,1,1,0,30,0])
49+
}
50+
end
51+
@@ -450,8 +456,11 @@ America/Managua Fri Jan 1 06:00:00 1993 UTC = Fri Jan 1 01:00:00 1993 EST isd
52+
America/Managua Wed Jan 1 04:59:59 1997 UTC = Tue Dec 31 23:59:59 1996 EST isdst=0 gmtoff=-18000
53+
America/Managua Wed Jan 1 05:00:00 1997 UTC = Tue Dec 31 23:00:00 1996 CST isdst=0 gmtoff=-21600
54+
Asia/Singapore Sun Aug 8 16:30:00 1965 UTC = Mon Aug 9 00:00:00 1965 SGT isdst=0 gmtoff=27000
55+
-Asia/Singapore Thu Dec 31 16:29:59 1981 UTC = Thu Dec 31 23:59:59 1981 SGT isdst=0 gmtoff=27000
56+
+Asia/Singapore Thu Dec 31 15:59:59 1981 UTC = Thu Dec 31 23:29:59 1981 SGT isdst=0 gmtoff=27000
57+
Asia/Singapore Thu Dec 31 16:30:00 1981 UTC = Fri Jan 1 00:30:00 1982 SGT isdst=0 gmtoff=28800
58+
+End
59+
+ gen_zdump_test <<'End' if CORRECT_SINGAPORE_1982
60+
+Asia/Singapore Thu Dec 31 16:00:00 1981 UTC = Fri Jan 1 00:00:00 1982 SGT isdst=0 gmtoff=28800
61+
End
62+
gen_zdump_test CORRECT_TOKYO_DST_1951 ? <<'End' + (CORRECT_TOKYO_DST_1951 < "2018f" ? <<'2018e' : <<'2018f') : <<'End'
63+
Asia/Tokyo Sat May 5 14:59:59 1951 UTC = Sat May 5 23:59:59 1951 JST isdst=0 gmtoff=32400

debian/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ ruby_default_arch.m4-don-t-require-arhitectures-to-be-kno.patch
99
test-zlib-test_zlib.rb-stop-a-failure-on-armv7l.patch
1010
Fallback-PKG_CONFIG-to-the-configured-pkg-config-always.patch
1111
Honor-the-tool-prefix-against-pkg-config.patch
12+
Fix-for-tzdata-2022g.patch

0 commit comments

Comments
 (0)