From f5482e4c38732db8912a68652735f8ddac020141 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 27 Feb 2012 08:03:24 +0000 Subject: * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): since methods can be overridden, so should not make an assumption on the type of results. [ruby-core:42969][Bug #6093] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/bigdecimal/test_bigdecimal.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/bigdecimal') diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb index 51dcb8e29b..deb2fa9a57 100644 --- a/test/bigdecimal/test_bigdecimal.rb +++ b/test/bigdecimal/test_bigdecimal.rb @@ -1,4 +1,5 @@ require_relative "testbase" +require_relative "../ruby/envutil" require 'thread' @@ -1303,4 +1304,10 @@ class TestBigDecimal < Test::Unit::TestCase assert_equal(1, y) assert_kind_of(c, y) end + + def test_to_d + bug6093 = '[ruby-core:42969]' + code = "exit(BigDecimal.new('10.0') == 10.0.to_d)" + assert_ruby_status(%w[-rbigdecimal -rbigdecimal/util -rmathn -], code, bug6093) + end end -- cgit v1.2.3