mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* numeric.c (rb_float_new_in_heap), include/ruby/ruby.h:
make all Float objects frozen. [ruby-dev:46081] [ruby-trunk - Feature #6936] Most part of patch by NARUSE, Yui <naruse@ruby-lang.org>. * class.c (singleton_class_of): raise TypeError when trying to define a singleton method on Float objects. * vm.c (vm_define_method): ditto. * test/ruby/marshaltestlib.rb: catch up above changes. * test/ruby/test_class.rb: ditto. * test/test_pp.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
909bc583a4
commit
180c744b3b
8 changed files with 27 additions and 36 deletions
|
@ -187,12 +187,8 @@ class TestClass < Test::Unit::TestCase
|
|||
|
||||
def test_singleton_class
|
||||
assert_raise(TypeError) { 1.extend(Module.new) }
|
||||
if 1.0.equal? 1.0 # flonum?
|
||||
assert_raise(TypeError) { 1.0.extend(Module.new) }
|
||||
else
|
||||
assert_nothing_raised { 1.0.extend(Module.new) }
|
||||
end
|
||||
assert_nothing_raised { (2.0**1000).extend(Module.new) }
|
||||
assert_raise(TypeError) { 1.0.extend(Module.new) }
|
||||
assert_raise(TypeError) { (2.0**1000).extend(Module.new) }
|
||||
assert_raise(TypeError) { :foo.extend(Module.new) }
|
||||
|
||||
assert_in_out_err([], <<-INPUT, %w(:foo :foo true true), [])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue