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

ruby-changes:40450

From: nobu <ko1@a...>
Date: Wed, 11 Nov 2015 09:07:20 +0900 (JST)
Subject: [ruby-changes:40450] nobu:r52531 (trunk): time/test_new.rb: fix tests

nobu	2015-11-11 09:07:16 +0900 (Wed, 11 Nov 2015)

  New Revision: 52531

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

  Log:
    time/test_new.rb: fix tests
    
    * test/-ext-/time/test_new.rb (test_timespec_new): fix for r52519.
      swap utc and localtime.
    
    * test/-ext-/time/test_new.rb (test_timespec_now): fix method name
      typo which has overwritten test_timespec_new.

  Modified files:
    trunk/test/-ext-/time/test_new.rb
Index: test/-ext-/time/test_new.rb
===================================================================
--- test/-ext-/time/test_new.rb	(revision 52530)
+++ test/-ext-/time/test_new.rb	(revision 52531)
@@ -20,9 +20,9 @@ class  Bug::Time::Test_New < Test::Unit: https://github.com/ruby/ruby/blob/trunk/test/-ext-/time/test_new.rb#L20
     assert_not_equal(Time.at(1447087832, 476451.128).localtime(32400),
                  Bug::Time.timespec_new(1447087832, 476451125, 32400))
     assert_equal(false, Bug::Time.timespec_new(1447087832, 476451125, 0).utc?)
-    assert_equal(true, Bug::Time.timespec_new(1447087832, 476451125, 0x7fffffff).utc?)
-    assert_equal(false, Bug::Time.timespec_new(1447087832, 476451125, 0x7ffffffe).utc?)
-    assert_equal(Time.now.gmtoff, Bug::Time.timespec_new(1447087832, 476451125, 0x7ffffffe).gmtoff)
+    assert_equal(true,  Bug::Time.timespec_new(1447087832, 476451125, 0x7ffffffe).utc?)
+    assert_equal(false, Bug::Time.timespec_new(1447087832, 476451125, 0x7fffffff).utc?)
+    assert_equal(Time.now.gmtoff, Bug::Time.timespec_new(1447087832, 476451125, 0x7fffffff).gmtoff)
     assert_time_equal(Time.at(1447087832, 476451.125).localtime(86399),
                  Bug::Time.timespec_new(1447087832, 476451125, 86399))
     assert_time_equal(Time.at(1447087832, 476451.125).localtime(-86399),
@@ -31,7 +31,7 @@ class  Bug::Time::Test_New < Test::Unit: https://github.com/ruby/ruby/blob/trunk/test/-ext-/time/test_new.rb#L31
     assert_raise(ArgumentError){Bug::Time.timespec_new(1447087832, 476451125,-86400)}
   end
 
-  def test_timespec_new
+  def test_timespec_now
     t0 = Time.now.to_r
     t = Bug::Time.timespec_now
     assert_in_delta 3, t0, t

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

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