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
@ -926,7 +926,13 @@ assert_equal 'true', %q{
|
|||||||
@a = 'foo'
|
@a = 'foo'
|
||||||
@b = 'bar'
|
@b = 'bar'
|
||||||
end
|
end
|
||||||
attr_reader :a, :b
|
|
||||||
|
def freeze
|
||||||
|
@c = [:freeze_called]
|
||||||
|
super
|
||||||
|
end
|
||||||
|
|
||||||
|
attr_reader :a, :b, :c
|
||||||
end
|
end
|
||||||
S = Struct.new(:s1, :s2)
|
S = Struct.new(:s1, :s2)
|
||||||
str = "hello"
|
str = "hello"
|
||||||
@ -967,6 +973,7 @@ assert_equal 'true', %q{
|
|||||||
when C
|
when C
|
||||||
raise o.a.inspect unless o.a.frozen?
|
raise o.a.inspect unless o.a.frozen?
|
||||||
raise o.b.inspect unless o.b.frozen?
|
raise o.b.inspect unless o.b.frozen?
|
||||||
|
raise o.c.inspect unless o.c.frozen? && o.c == [:freeze_called]
|
||||||
when Rational
|
when Rational
|
||||||
raise o.numerator.inspect unless o.numerator.frozen?
|
raise o.numerator.inspect unless o.numerator.frozen?
|
||||||
when Complex
|
when Complex
|
||||||
|
Loading…
x
Reference in New Issue
Block a user