diff options
author | Victor Shepelev <zverok.offline@gmail.com> | 2024-08-18 13:15:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-18 13:15:18 +0300 |
commit | d450f9d6a28f01b7ca6030a925921dbf35cee439 (patch) | |
tree | 287feda2769e22ddc5e698ca55a993e3472b2a0d /test/ruby/test_dir.rb | |
parent | 4dbf386ca248df0f47f31dc28cdeabe8d4477e5b (diff) | |
download | ruby-d450f9d6a28f01b7ca6030a925921dbf35cee439.tar.gz |
Make Range#step to consistently use + for iteration (#7444)
Make Range#step to consistently use + for iteration [Feature #18368]
Previously, non-numerics expected step to be integer,
and iterated with begin#succ, skipping over step value
steps. Since this commit, numeric and non-numeric iteration
behaves the same way, by using + operator.
Diffstat (limited to 'test/ruby/test_dir.rb')
-rw-r--r-- | test/ruby/test_dir.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb index 2cc1c3ef4a..b86cf330bc 100644 --- a/test/ruby/test_dir.rb +++ b/test/ruby/test_dir.rb @@ -256,7 +256,7 @@ class TestDir < Test::Unit::TestCase Dir.glob(@root, sort: nil) end - assert_equal(("a".."z").step(2).map {|f| File.join(File.join(@root, f), "") }, + assert_equal(("a".."z").each_slice(2).map {|f,_| File.join(File.join(@root, f), "") }, Dir.glob(File.join(@root, "*/"))) assert_equal([File.join(@root, '//a')], Dir.glob(@root + '//a')) |