diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-12-03 11:58:39 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-12-03 11:58:39 +0900 |
| commit | d89cfca02c2f632cef443442339136b89ff15017 (patch) | |
| tree | d58add6e0192b205b5a34c276df92153bc271f45 /mrbgems/mruby-enumerator/test/enumerator.rb | |
| parent | e673fbb35a0c439bb4685cd0a6784f93a4856c07 (diff) | |
| parent | 2718fed1248872e6af436159a8f336fb54b86df2 (diff) | |
| download | mruby-d89cfca02c2f632cef443442339136b89ff15017.tar.gz mruby-d89cfca02c2f632cef443442339136b89ff15017.zip | |
Merge pull request #3315 from ksss/enumerator-with_index
Fix some incompatibility for Enumerator#with_index
Diffstat (limited to 'mrbgems/mruby-enumerator/test/enumerator.rb')
| -rw-r--r-- | mrbgems/mruby-enumerator/test/enumerator.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mrbgems/mruby-enumerator/test/enumerator.rb b/mrbgems/mruby-enumerator/test/enumerator.rb index 2e45dae4b..e86e874f0 100644 --- a/mrbgems/mruby-enumerator/test/enumerator.rb +++ b/mrbgems/mruby-enumerator/test/enumerator.rb @@ -50,6 +50,9 @@ end assert 'Enumerator#with_index' do assert_equal([[1,0],[2,1],[3,2]], @obj.to_enum(:foo, 1, 2, 3).with_index.to_a) assert_equal([[1,5],[2,6],[3,7]], @obj.to_enum(:foo, 1, 2, 3).with_index(5).to_a) + a = [] + @obj.to_enum(:foo, 1, 2, 3).with_index(10).with_index(20) { |*i| a << i } + assert_equal [[[1, 10], 20], [[2, 11], 21], [[3, 12], 22]], a end assert 'Enumerator#with_index nonnum offset' do |
