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

ruby-changes:21142

From: nobu <ko1@a...>
Date: Mon, 5 Sep 2011 17:46:58 +0900 (JST)
Subject: [ruby-changes:21142] nobu:r33191 (trunk): * test/ruby/test_float.rb (TestFloat#test_round): show the number in question.

nobu	2011-09-05 17:46:44 +0900 (Mon, 05 Sep 2011)

  New Revision: 33191

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

  Log:
    * test/ruby/test_float.rb (TestFloat#test_round): show the number in question.

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

Index: test/ruby/test_float.rb
===================================================================
--- test/ruby/test_float.rb	(revision 33190)
+++ test/ruby/test_float.rb	(revision 33191)
@@ -452,15 +452,16 @@
 
   def test_round
     VS.each {|f|
+      msg = "round(#{f})"
       i = f.round
       if f < 0
-        assert_operator(i, :<, 0)
+        assert_operator(i, :<, 0, msg)
       else
-        assert_operator(i, :>, 0)
+        assert_operator(i, :>, 0, msg)
       end
       d = f - i
-      assert_operator(-0.5, :<=, d)
-      assert_operator(d, :<=, 0.5)
+      assert_operator(-0.5, :<=, d, msg)
+      assert_operator(d, :<=, 0.5, msg)
     }
   end
 

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

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