diff options
Diffstat (limited to 'test/ruby/test_float.rb')
-rw-r--r-- | test/ruby/test_float.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index a63c18f8bc..2ac394465f 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -600,4 +600,11 @@ class TestFloat < Test::Unit::TestCase assert_operator(n, :<=, e) end end + + def test_singleton_method + # flonum on 64bit platform + assert_raise(TypeError) { a = 1.0; def a.foo; end } + # always not flonum + assert_raise(TypeError) { a = Float::INFINITY; def a.foo; end } + end end |