diff options
Diffstat (limited to 'test/ruby/test_float.rb')
-rw-r--r-- | test/ruby/test_float.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index fffa96e313..b465814140 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -442,6 +442,18 @@ class TestFloat < Test::Unit::TestCase assert(Float(o).nan?) end + def test_invalid_str + bug4310 = '[ruby-core:34820]' + assert_raise(ArgumentError, bug4310) { + stress, GC.stress = GC.stress, true + begin + Float('a'*10000) + ensure + GC.stress = stress + end + } + end + def test_num2dbl assert_raise(TypeError) do 1.0.step(2.0, "0.5") {} |