[ruby-cvs:71650] usa:r64558 (ruby_2_4): merge revision(s) 62731, 62735: [Backport #14495]

usa at ruby-lang.org usa at ruby-lang.org
Mon Aug 27 22:47:40 JST 2018


usa	2018-08-27 22:47:40 +0900 (Mon, 27 Aug 2018)

  New Revision: 64558

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64558

  Log:
    merge revision(s) 62731,62735: [Backport #14495]
    
    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 at rocketbox.in>
    
    test_enumerator.rb: duplicate assertions
    
    * test/ruby/test_enumerator.rb (test_uniq): remove assertions
      which ared duplicate of lazy enumerator tests in
      test_lazy_enumerator.rb.

  Modified directories:
    branches/ruby_2_4/
  Modified files:
    branches/ruby_2_4/enumerator.c
    branches/ruby_2_4/test/ruby/test_enumerator.rb
    branches/ruby_2_4/test/ruby/test_lazy_enumerator.rb
    branches/ruby_2_4/version.h


More information about the ruby-cvs mailing list