1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Added false case

This commit is contained in:
Nobuyoshi Nakada 2020-10-22 16:24:38 +09:00
parent d19601fb56
commit 78cb9b627b
Notes: git 2020-12-14 19:19:45 +09:00

View file

@ -1178,12 +1178,17 @@ x = __ENCODING__
assert_warning(/invalid value/) do
assert_valid_syntax("# shareable_constant_value: invalid-option", verbose: true)
end
a = Class.new.class_eval("#{<<~"begin;"}\n#{<<~'end;'}")
a, b = Class.new.class_eval("#{<<~"begin;"}\n#{<<~'end;'}")
begin;
# shareable_constant_value: true
A = [[1]]
# shareable_constant_value: false
B = [[2]]
[A, B]
end;
assert_send([Ractor, :shareable?, a])
assert_not_send([Ractor, :shareable?, b])
assert_equal([1], a[0])
assert_send([Ractor, :shareable?, a[0]])
a, b = Class.new.class_eval("#{<<~"begin;"}\n#{<<~'end;'}")