mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Added assertions
This commit is contained in:
parent
0c450b8647
commit
d1c7db9d00
Notes:
git
2020-12-23 13:51:07 +09:00
1 changed files with 21 additions and 1 deletions
|
@ -1222,7 +1222,8 @@ x = __ENCODING__
|
|||
# shareable_constant_value: none
|
||||
class X
|
||||
# shareable_constant_value: experimental_everything
|
||||
A = [[1]]
|
||||
var = [[1]]
|
||||
A = var
|
||||
end
|
||||
B = []
|
||||
[X::A, B]
|
||||
|
@ -1237,6 +1238,25 @@ x = __ENCODING__
|
|||
# shareable_constant_value: literal
|
||||
C = ["Not " + "shareable"]
|
||||
end;
|
||||
|
||||
c, d = eval_separately("#{<<~"begin;"}\n#{<<~'end;'}")
|
||||
begin;
|
||||
# shareable_constant_value: literal
|
||||
var = [:not_frozen]
|
||||
C = var
|
||||
D = begin [] end
|
||||
[C, D]
|
||||
end;
|
||||
assert_not_ractor_shareable(c)
|
||||
assert_not_ractor_shareable(d)
|
||||
|
||||
assert_ractor_error(/does not freeze object correctly/, "#{<<~"begin;"}\n#{<<~'end;'}")
|
||||
begin;
|
||||
# shareable_constant_value: experimental_everything
|
||||
o = Object.new
|
||||
def o.freeze; self; end
|
||||
C = [o]
|
||||
end;
|
||||
end
|
||||
|
||||
=begin
|
||||
|
|
Loading…
Reference in a new issue