mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add test that Ractor.make_shareable
calls user defined #freeze
This commit is contained in:
parent
2553c5f94a
commit
27b6df9653
Notes:
git
2020-12-09 07:49:41 +09:00
1 changed files with 8 additions and 1 deletions
|
@ -926,7 +926,13 @@ assert_equal 'true', %q{
|
|||
@a = 'foo'
|
||||
@b = 'bar'
|
||||
end
|
||||
attr_reader :a, :b
|
||||
|
||||
def freeze
|
||||
@c = [:freeze_called]
|
||||
super
|
||||
end
|
||||
|
||||
attr_reader :a, :b, :c
|
||||
end
|
||||
S = Struct.new(:s1, :s2)
|
||||
str = "hello"
|
||||
|
@ -967,6 +973,7 @@ assert_equal 'true', %q{
|
|||
when C
|
||||
raise o.a.inspect unless o.a.frozen?
|
||||
raise o.b.inspect unless o.b.frozen?
|
||||
raise o.c.inspect unless o.c.frozen? && o.c == [:freeze_called]
|
||||
when Rational
|
||||
raise o.numerator.inspect unless o.numerator.frozen?
|
||||
when Complex
|
||||
|
|
Loading…
Add table
Reference in a new issue