diff options
author | Jean Boussier <[email protected]> | 2022-09-04 09:44:59 +0200 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2022-09-04 11:16:11 +0200 |
commit | bbe5ec78463f8d6ef2e1a3571f17357a3d9ec8e4 (patch) | |
tree | 6fc194a3bd61c425629478d3ea6a7f99a0cabf55 /spec/ruby/core/range | |
parent | cfa40e225adb30b777ef50d9d8dc15a51e3d2797 (diff) |
rb_int_range_last: properly handle non-exclusive range
[Bug #18994]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6324
Diffstat (limited to 'spec/ruby/core/range')
-rw-r--r-- | spec/ruby/core/range/last_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/core/range/last_spec.rb b/spec/ruby/core/range/last_spec.rb index d7ef776b42..6698686dd5 100644 --- a/spec/ruby/core/range/last_spec.rb +++ b/spec/ruby/core/range/last_spec.rb @@ -8,6 +8,12 @@ describe "Range#last" do (1..5).last(3).should == [3, 4, 5] end + ruby_bug '#18994', '2.7'...'3.2' do + it "returns the specified number if elements for single element inclusive range" do + (1..1).last(1).should == [1] + end + end + it "returns an empty array for an empty Range" do (0...0).last(2).should == [] end |