[前][次][番号順一覧][スレッド一覧]

ruby-changes:16291

From: akr <ko1@a...>
Date: Fri, 11 Jun 2010 00:27:13 +0900 (JST)
Subject: [ruby-changes:16291] Ruby:r28260 (trunk): more tests

akr	2010-06-11 00:27:07 +0900 (Fri, 11 Jun 2010)

  New Revision: 28260

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28260

  Log:
    more tests

  Modified files:
    trunk/test/ruby/test_time_tz.rb

Index: test/ruby/test_time_tz.rb
===================================================================
--- test/ruby/test_time_tz.rb	(revision 28259)
+++ test/ruby/test_time_tz.rb	(revision 28260)
@@ -177,12 +177,16 @@
                  gmtoff]
     }
     sample.each {|tz, u, l, gmtoff|
+      expected_utc = "%04d-%02d-%02d %02d:%02d:%02d UTC" % u
       expected = "%04d-%02d-%02d %02d:%02d:%02d %s" % (l+[format_gmtoff(gmtoff)])
-      mesg = "TZ=#{tz} Time.utc(#{u.map {|arg| arg.inspect }.join(', ')}).localtime"
+      mesg_utc = "TZ=#{tz} Time.utc(#{u.map {|arg| arg.inspect }.join(', ')})"
+      mesg = "#{mesg_utc}.localtime"
       define_method(gen_test_name(tz)) {
         with_tz(tz) {
           t = nil
-          assert_nothing_raised(mesg) { t = Time.utc(*u).localtime }
+          assert_nothing_raised(mesg) { t = Time.utc(*u) }
+          assert_equal(expected_utc, time_to_s(t), mesg_utc)
+          assert_nothing_raised(mesg) { t.localtime }
           assert_equal(expected, time_to_s(t), mesg)
           assert_equal(gmtoff, t.gmtoff)
         }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]