summaryrefslogtreecommitdiff
path: root/spec/ruby/optional
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2022-09-26 16:09:50 -0700
committerAaron Patterson <tenderlove@ruby-lang.org>2022-09-26 16:10:11 -0700
commit06abfa5be60e589052eb3bdfdae6c132bea3d20b (patch)
tree32200df9a517d30a92dfe1003057e03cfba44701 /spec/ruby/optional
parentb39690df3a90a838cdb2de71e70a20651ebafaf4 (diff)
downloadruby-06abfa5be60e589052eb3bdfdae6c132bea3d20b.tar.gz
Revert this until we can figure out WB issues or remove shapes from GC
Revert "* expand tabs. [ci skip]" This reverts commit 830b5b5c351c5c6efa5ad461ae4ec5085e5f0275. Revert "This commit implements the Object Shapes technique in CRuby." This reverts commit 9ddfd2ca004d1952be79cf1b84c52c79a55978f4.
Diffstat (limited to 'spec/ruby/optional')
-rw-r--r--spec/ruby/optional/capi/shared/rbasic.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/ruby/optional/capi/shared/rbasic.rb b/spec/ruby/optional/capi/shared/rbasic.rb
index 105408ec3d..99c2044bd7 100644
--- a/spec/ruby/optional/capi/shared/rbasic.rb
+++ b/spec/ruby/optional/capi/shared/rbasic.rb
@@ -8,9 +8,16 @@ describe :rbasic, shared: true do
it "reports the appropriate FREEZE flag for the object when reading" do
obj, _ = @data.call
- (@specs.get_flags(obj) & @freeze).should == 0
+ initial = @specs.get_flags(obj)
obj.freeze
- (@specs.get_flags(obj) & @freeze).should == @freeze
+ @specs.get_flags(obj).should == @freeze | initial
+ end
+
+ it "supports setting the FREEZE flag" do
+ obj, _ = @data.call
+ initial = @specs.get_flags(obj)
+ @specs.set_flags(obj, @freeze | initial).should == @freeze | initial
+ obj.should.frozen?
end
it "supports retrieving the (meta)class" do