diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-10-22 16:24:38 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-12-14 19:19:16 +0900 |
commit | 78cb9b627b19069abad5b27f1710abacf1eed064 (patch) | |
tree | 00d72a4d85b39c205f67f7b3de7f06d59064d7a9 /test/ruby/test_parse.rb | |
parent | d19601fb569a2b3adea1bfb1938820314833a475 (diff) |
Added false case
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3681
Diffstat (limited to 'test/ruby/test_parse.rb')
-rw-r--r-- | test/ruby/test_parse.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 46c2ad531b..d476a9d62c 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -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;'}") |