1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Implement Proc#== and #eql?

Previously, these were not implemented, and Object#== and #eql?
were used.  This tries to check the proc internals to make sure
that procs created from separate blocks are treated as not equal,
but procs created from the same block are treated as equal, even
when the lazy proc allocation optimization is used.

Implements [Feature #14267]
This commit is contained in:
Jeremy Evans 2020-06-01 12:28:05 -07:00
parent b3aff6a11c
commit 878af5147d
Notes: git 2020-06-20 04:58:52 +09:00
5 changed files with 93 additions and 9 deletions

View file

@ -2,5 +2,11 @@ require_relative '../../spec_helper'
require_relative 'shared/equal'
describe "Proc#eql?" do
it_behaves_like :proc_equal_undefined, :eql?
ruby_version_is "0"..."2.8" do
it_behaves_like :proc_equal_undefined, :eql?
end
ruby_version_is "2.8" do
it_behaves_like :proc_equal, :eql?
end
end