We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8132867 commit c7708d2Copy full SHA for c7708d2
test/ruby/test_proc.rb
@@ -186,6 +186,18 @@ def self.capture(&block)
186
187
procs = Array.new(1000){capture{:foo }}
188
assert_operator(procs.map(&:hash).uniq.size, :>=, 500)
189
+
190
+ # iseq backed proc
191
+ unique_hashes = 1000.times.map { proc {}.hash }.uniq
192
+ assert_operator(unique_hashes.size, :>=, 500)
193
194
+ # ifunc backed proc
195
+ unique_hashes = 1000.times.map { {}.to_proc.hash }.uniq
196
197
198
+ # symbol backed proc
199
+ unique_hashes = 1000.times.map { |i| :"test#{i}".to_proc.hash }.uniq
200
201
end
202
203
def test_hash_does_not_change_after_compaction
0 commit comments