@@ -7,9 +7,9 @@ class TestTimeTZ < Test::Unit::TestCase
7
7
has_lisbon_tz = true
8
8
force_tz_test = ENV [ "RUBY_FORCE_TIME_TZ_TEST" ] == "yes"
9
9
case RUBY_PLATFORM
10
- when /linux/
10
+ when /darwin| linux/
11
11
force_tz_test = true
12
- when /darwin| freebsd|openbsd/
12
+ when /freebsd|openbsd/
13
13
has_lisbon_tz = false
14
14
force_tz_test = true
15
15
end
@@ -95,6 +95,9 @@ def group_by(e, &block)
95
95
CORRECT_KIRITIMATI_SKIP_1994 = with_tz ( "Pacific/Kiritimati" ) {
96
96
Time . local ( 1994 , 12 , 31 , 0 , 0 , 0 ) . year == 1995
97
97
}
98
+ CORRECT_SINGAPORE_1982 = with_tz ( "Asia/Singapore" ) {
99
+ "2022g" if Time . local ( 1981 , 12 , 31 , 23 , 59 , 59 ) . utc_offset == 8 *3600
100
+ }
98
101
99
102
def time_to_s ( t )
100
103
t . to_s
@@ -112,7 +115,7 @@ def test_localtime_zone
112
115
t = with_tz ( "America/Los_Angeles" ) {
113
116
Time . local ( 2000 , 1 , 1 )
114
117
}
115
- skip "force_tz_test is false on this environment" unless t
118
+ omit "force_tz_test is false on this environment" unless t
116
119
z1 = t . zone
117
120
z2 = with_tz ( tz = "Asia/Singapore" ) {
118
121
t . localtime . zone
@@ -140,9 +143,12 @@ def test_america_managua
140
143
141
144
def test_asia_singapore
142
145
with_tz ( tz = "Asia/Singapore" ) {
143
- assert_time_constructor ( tz , "1981-12-31 23:59:59 +0730" , :local , [ 1981 , 12 , 31 , 23 , 59 , 59 ] )
144
- assert_time_constructor ( tz , "1982-01-01 00:30:00 +0800" , :local , [ 1982 , 1 , 1 , 0 , 0 , 0 ] )
145
- assert_time_constructor ( tz , "1982-01-01 00:59:59 +0800" , :local , [ 1982 , 1 , 1 , 0 , 29 , 59 ] )
146
+ assert_time_constructor ( tz , "1981-12-31 23:29:59 +0730" , :local , [ 1981 , 12 , 31 , 23 , 29 , 59 ] )
147
+ if CORRECT_SINGAPORE_1982
148
+ assert_time_constructor ( tz , "1982-01-01 00:00:00 +0800" , :local , [ 1981 , 12 , 31 , 23 , 30 , 00 ] )
149
+ assert_time_constructor ( tz , "1982-01-01 00:00:00 +0800" , :local , [ 1982 , 1 , 1 , 0 , 0 , 0 ] )
150
+ assert_time_constructor ( tz , "1982-01-01 00:29:59 +0800" , :local , [ 1982 , 1 , 1 , 0 , 29 , 59 ] )
151
+ end
146
152
assert_time_constructor ( tz , "1982-01-01 00:30:00 +0800" , :local , [ 1982 , 1 , 1 , 0 , 30 , 0 ] )
147
153
}
148
154
end
@@ -450,8 +456,11 @@ def self.gen_zdump_test(data)
450
456
America/Managua Wed Jan 1 04:59:59 1997 UTC = Tue Dec 31 23:59:59 1996 EST isdst=0 gmtoff=-18000
451
457
America/Managua Wed Jan 1 05:00:00 1997 UTC = Tue Dec 31 23:00:00 1996 CST isdst=0 gmtoff=-21600
452
458
Asia/Singapore Sun Aug 8 16:30:00 1965 UTC = Mon Aug 9 00:00:00 1965 SGT isdst=0 gmtoff=27000
453
- Asia/Singapore Thu Dec 31 16:29 :59 1981 UTC = Thu Dec 31 23:59 :59 1981 SGT isdst=0 gmtoff=27000
459
+ Asia/Singapore Thu Dec 31 15:59 :59 1981 UTC = Thu Dec 31 23:29 :59 1981 SGT isdst=0 gmtoff=27000
454
460
Asia/Singapore Thu Dec 31 16:30:00 1981 UTC = Fri Jan 1 00:30:00 1982 SGT isdst=0 gmtoff=28800
461
+ End
462
+ gen_zdump_test <<'End' if CORRECT_SINGAPORE_1982
463
+ Asia/Singapore Thu Dec 31 16:00:00 1981 UTC = Fri Jan 1 00:00:00 1982 SGT isdst=0 gmtoff=28800
455
464
End
456
465
gen_zdump_test CORRECT_TOKYO_DST_1951 ? <<'End' + ( CORRECT_TOKYO_DST_1951 < "2018f" ? <<'2018e' : <<'2018f' ) : <<'End'
457
466
Asia/Tokyo Sat May 5 14:59:59 1951 UTC = Sat May 5 23:59:59 1951 JST isdst=0 gmtoff=32400
0 commit comments