diff options
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r-- | test/ruby/test_array.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 6c7f920d79..ae0f76c970 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -2249,6 +2249,12 @@ class TestArray < Test::Unit::TestCase assert_raise(ArgumentError) { a.rotate!(1, 1) } end + def test_bsearch_with_no_block + enum = [1, 2, 42, 100, 666].bsearch + assert_nil enum.size + assert_equal 42, enum.each{|x| x >= 33 } + end + def test_bsearch_in_find_minimum_mode a = [0, 4, 7, 10, 12] assert_equal(4, a.bsearch {|x| x >= 4 }) |