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

ruby-changes:36315

From: headius <ko1@a...>
Date: Thu, 13 Nov 2014 14:31:17 +0900 (JST)
Subject: [ruby-changes:36315] headius:r48396 (trunk): * test/bigdecimal/test_bigdecimal.rb: Add test for mult by nil.

headius	2014-11-13 14:31:00 +0900 (Thu, 13 Nov 2014)

  New Revision: 48396

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

  Log:
    * test/bigdecimal/test_bigdecimal.rb: Add test for mult by nil.

  Modified files:
    trunk/test/bigdecimal/test_bigdecimal.rb
Index: test/bigdecimal/test_bigdecimal.rb
===================================================================
--- test/bigdecimal/test_bigdecimal.rb	(revision 48395)
+++ test/bigdecimal/test_bigdecimal.rb	(revision 48396)
@@ -694,6 +694,12 @@ class TestBigDecimal < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/bigdecimal/test_bigdecimal.rb#L694
     assert_kind_of(BigDecimal, BigDecimal.new("3") * 1.quo(3))
   end
 
+  def test_mult_with_nil
+    assert_raise(TypeError) {
+      BigDecimal('1.1') * nil
+    }
+  end
+
   def test_div
     x = BigDecimal.new((2**100).to_s)
     assert_equal(BigDecimal.new((2**100 / 3).to_s), (x / 3).to_i)

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

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