1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/core/enumerator
nobu 0faf018624 Bug Fix Enumerator::Lazy#uniq state for multiple call
* enumerator.c (lazy_uniq_i): create new hash for each calls.
  [Fix GH-1820]

Currently

	2.5.0-preview1 :001 > arr = (0..100).lazy.uniq{|i| i % 10}
	 => #<Enumerator::Lazy: #<Enumerator::Lazy: 0..100>:uniq>
	2.5.0-preview1 :002 > arr.to_a
	 => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
	2.5.0-preview1 :003 > arr.to_a
	 => []

Expected

arr.to_a to always return same output

From: Anmol Chopra <anmolchopra@rocketbox.in>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 01:00:08 +00:00
..
fixtures
generator
lazy Bug Fix Enumerator::Lazy#uniq state for multiple call 2018-03-13 01:00:08 +00:00
yielder
each_spec.rb
each_with_index_spec.rb
each_with_object_spec.rb
enum_for_spec.rb
enumerator_spec.rb
feed_spec.rb
first_spec.rb
initialize_spec.rb
inject_spec.rb
inspect_spec.rb
new_spec.rb
next_spec.rb
next_values_spec.rb
peek_spec.rb
peek_values_spec.rb
rewind_spec.rb
size_spec.rb
to_enum_spec.rb
with_index_spec.rb
with_object_spec.rb