⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (535 Bytes)
Bug #14263
» array_intersection.rb
Failing array intersection test -
gkellogg (Gregg Kellogg)
, 12/31/2017 09:58 PM
# Demonstrates that [Var.new('a')] & [Var.new('b')] is not empty when #eql? is true and hash comparison fails in Ruby 2.5.0. Works in Ruby 2.4.2.
# The documentation for Array#& says it uses both hash and eql?, but it seems to not be true in Ruby 2.5.0
class
Var
attr_reader
:v
def
initialize
(
v
)
@v
=
v
end
def
eql?
(
other
)
true
end
def
hash
v
.
hash
end
end
if
([
Var
.
new
(
'a'
)]
&
[
Var
.
new
(
'b'
)]).
empty?
puts
"success: RUBY_VERSION:
#{
RUBY_VERSION
}
"
else
puts
"failure: RUBY_VERSION:
#{
RUBY_VERSION
}
"
end
« Previous
1
2
3
4
Next »
(1-1/4)
Loading...