mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
DO NOT CORRUPT TYPE FLAGS
This commit is contained in:
parent
9998161b10
commit
717680f197
1 changed files with 11 additions and 8 deletions
|
@ -56,20 +56,23 @@ describe :rbasic, shared: true do
|
|||
|
||||
it "supports user flags" do
|
||||
obj, _ = @data.call
|
||||
@specs.get_flags(obj).should == 0
|
||||
@specs.set_flags(obj, 1 << 14 | 1 << 16).should == 1 << 14 | 1 << 16
|
||||
@specs.get_flags(obj).should == 1 << 14 | 1 << 16
|
||||
@specs.set_flags(obj, 0).should == 0
|
||||
initial = @specs.get_flags(obj)
|
||||
initial.should_not == 0
|
||||
@specs.set_flags(obj, 1 << 14 | 1 << 16 | initial).should == 1 << 14 | 1 << 16 | initial
|
||||
@specs.get_flags(obj).should == 1 << 14 | 1 << 16 | initial
|
||||
@specs.set_flags(obj, initial).should == initial
|
||||
end
|
||||
|
||||
it "supports copying the flags from one object over to the other" do
|
||||
obj1, obj2 = @data.call
|
||||
@specs.set_flags(obj1, @taint | 1 << 14 | 1 << 16)
|
||||
initial = @specs.get_flags(obj1)
|
||||
@specs.get_flags(obj2).should == initial
|
||||
@specs.set_flags(obj1, @taint | 1 << 14 | 1 << 16 | initial)
|
||||
@specs.copy_flags(obj2, obj1)
|
||||
@specs.get_flags(obj2).should == @taint | 1 << 14 | 1 << 16
|
||||
@specs.set_flags(obj1, 0)
|
||||
@specs.get_flags(obj2).should == @taint | 1 << 14 | 1 << 16 | initial
|
||||
@specs.set_flags(obj1, initial)
|
||||
@specs.copy_flags(obj2, obj1)
|
||||
@specs.get_flags(obj2).should == 0
|
||||
@specs.get_flags(obj2).should == initial
|
||||
end
|
||||
|
||||
it "supports retrieving the (meta)class" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue