1
0
Fork 0
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:
Marc-Andre Lafortune 2020-10-23 17:42:48 -04:00 committed by Marc-André Lafortune
parent 2553c5f94a
commit 27b6df9653
Notes: git 2020-12-09 07:49:41 +09:00

View file

@ -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