diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-12 05:02:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-12 05:02:58 +0000 |
commit | 62c17a2f21b47243071075cbef37fe72b6ecd0ff (patch) | |
tree | 100d361f2c1256e4d29691fd2434d1fe5682273a /test | |
parent | 52a97e36d09ae15800c2a52094759c18e7be4ee0 (diff) | |
download | ruby-62c17a2f21b47243071075cbef37fe72b6ecd0ff.tar.gz |
No TypeError at nil if exception: false
[ruby-core:91021] [Bug #15525]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_complex.rb | 6 | ||||
-rw-r--r-- | test/ruby/test_rational.rb | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb index 80d1dc7e55..3da66890c1 100644 --- a/test/ruby/test_complex.rb +++ b/test/ruby/test_complex.rb @@ -866,9 +866,15 @@ class Complex_Test < Test::Unit::TestCase assert_equal(nil, Complex('5x', exception: false)) } assert_nothing_raised(ArgumentError){ + assert_equal(nil, Complex(nil, exception: false)) + } + assert_nothing_raised(ArgumentError){ assert_equal(nil, Complex(Object.new, exception: false)) } assert_nothing_raised(ArgumentError){ + assert_equal(nil, Complex(1, nil, exception: false)) + } + assert_nothing_raised(ArgumentError){ assert_equal(nil, Complex(1, Object.new, exception: false)) } diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb index b289753347..a8cdf22a49 100644 --- a/test/ruby/test_rational.rb +++ b/test/ruby/test_rational.rb @@ -816,9 +816,15 @@ class Rational_Test < Test::Unit::TestCase assert_equal(nil, Rational("1/0", exception: false)) } assert_nothing_raised(TypeError) { + assert_equal(nil, Rational(nil, exception: false)) + } + assert_nothing_raised(TypeError) { assert_equal(nil, Rational(Object.new, exception: false)) } assert_nothing_raised(TypeError) { + assert_equal(nil, Rational(1, nil, exception: false)) + } + assert_nothing_raised(TypeError) { assert_equal(nil, Rational(1, Object.new, exception: false)) } |