Bug #6454 » rb_mod_init_copy.bug6454.patch
class.c (working copy) | ||
---|---|---|
st_free_table(RCLASS_IV_TBL(clone));
|
||
}
|
||
RCLASS_IV_TBL(clone) = st_copy(RCLASS_IV_TBL(orig));
|
||
CONST_ID(id, "__tmp_classpath__");
|
||
st_delete(RCLASS_IV_TBL(clone), &id, 0);
|
||
CONST_ID(id, "__classpath__");
|
||
st_delete(RCLASS_IV_TBL(clone), &id, 0);
|
||
CONST_ID(id, "__classid__");
|
test/ruby/test_module.rb (working copy) | ||
---|---|---|
assert_equal([:MIXIN, :USER], User.constants.sort)
|
||
end
|
||
def test_dup
|
||
bug6454 = '[ruby-core:45132]'
|
||
a = Module.new
|
||
Other.const_set :BUG6454, a
|
||
original = Other::BUG6454.inspect
|
||
b = a.dup
|
||
Other.const_set :BUG6454_dup, b
|
||
assert_equal "TestModule::Other::BUG6454_dup", b.inspect, bug6454
|
||
end
|
||
def test_dup_anonymous
|
||
bug6454 = '[ruby-core:45132]'
|
||
a = Module.new
|
||
original = a.inspect
|
||
b = a.dup
|
||
refute_equal original, b.inspect, bug6454
|
||
end
|
||
def test_included_modules
|
||
assert_equal([], Mixin.included_modules)
|
||
assert_equal([Mixin], User.included_modules)
|