Skip to content

Commit

Permalink
Add spec for Pointer eql?'ity for #2995.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed May 28, 2015
1 parent 7551aa7 commit e0b1489
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/ffi/pointer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ def to_ptr
expect(FFI::MemoryPointer.new(:int, 1).type_size).to eq(FFI.type_size(:int))
end
end

it "is not eql? for purposes of hash lookup (GH-2995)" do
a = FFI::Pointer.new(0)
b = FFI::Pointer.new(0)

expect(a == b).to eq true
expect(a.eql? b).to eq false
expect(Hash[a,true][b]).to eq nil
end
end

describe "AutoPointer" do
Expand Down

0 comments on commit e0b1489

Please sign in to comment.