diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-03 08:35:57 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-03 08:35:57 +0000 |
commit | d4319541e870b3ec37ddb73d399dafcb39db35e7 (patch) | |
tree | c26843ab9f435c9de64822c904bdf4707a53a730 /test/ruby | |
parent | 95f7992b89efd35de6b28ac095c4d3477019c583 (diff) | |
download | ruby-d4319541e870b3ec37ddb73d399dafcb39db35e7.tar.gz |
range.c (r_cover_range_p): support beginless range
`(..2).cover?(..1)` should return true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_range.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb index 6c1761f3b0..b631c7d2b9 100644 --- a/test/ruby/test_range.rb +++ b/test/ruby/test_range.rb @@ -581,6 +581,9 @@ class TestRange < Test::Unit::TestCase assert_operator(2.., :cover?, 2..) assert_operator(2.., :cover?, 3..) assert_operator(1.., :cover?, 1..10) + assert_operator(..2, :cover?, ..2) + assert_operator(..2, :cover?, ..1) + assert_operator(..2, :cover?, 0..1) assert_operator(2.0..5.0, :cover?, 2..3) assert_operator(2..5, :cover?, 2.0..3.0) assert_operator(2..5, :cover?, 2.0...3.0) @@ -604,7 +607,9 @@ class TestRange < Test::Unit::TestCase assert_not_operator(1...2, :cover?, 1...3) assert_not_operator(2.., :cover?, 1..) assert_not_operator(2.., :cover?, 1..10) + assert_not_operator(2.., :cover?, ..10) assert_not_operator(1..10, :cover?, 1..) + assert_not_operator(1..10, :cover?, ..1) assert_not_operator(1..5, :cover?, 3..2) assert_not_operator(1..10, :cover?, 3...2) assert_not_operator(1..10, :cover?, 3...3) |