summaryrefslogtreecommitdiff
path: root/test/ruby/test_time_tz.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-10 14:10:25 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-10 14:10:25 +0000
commit094ca0281e1ddbfcd9d7c36363cea2222885527b (patch)
tree206cbfd6333775ad68344780be7777bc07177f71 /test/ruby/test_time_tz.rb
parentebda24ccd876257655305d73a9b2b496b381884a (diff)
* time.c (rb_localtime_r2): refine localtime overflow check for
FreeBSD 6.4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_time_tz.rb')
-rw-r--r--test/ruby/test_time_tz.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb
index ea7b51d5d2..4e781cd820 100644
--- a/test/ruby/test_time_tz.rb
+++ b/test/ruby/test_time_tz.rb
@@ -153,8 +153,10 @@ class TestTimeTZ < Test::Unit::TestCase
sample.each {|tz, u, l, gmtoff|
with_tz(tz) {
expected = "%04d-%02d-%02d %02d:%02d:%02d %s" % (l+[format_gmtoff(gmtoff)])
- t = Time.utc(*u).localtime
- assert_equal(expected, time_to_s(t), "TZ=#{tz} Time.utc(#{u.map(&:inspect).join(', ')}).localtime")
+ mesg = "TZ=#{tz} Time.utc(#{u.map(&:inspect).join(', ')}).localtime"
+ t = nil
+ assert_nothing_raised(mesg) { t = Time.utc(*u).localtime }
+ assert_equal(expected, time_to_s(t), mesg)
assert_equal(gmtoff, t.gmtoff)
}
}