From 451574f1420d8533f44a06d9aca23b5647292228 Mon Sep 17 00:00:00 2001 From: Christopher Aue Date: Fri, 28 Jul 2017 17:02:36 +0200 Subject: Refactored Array#bsearch --- mrbgems/mruby-array-ext/test/array.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mrbgems/mruby-array-ext/test/array.rb') diff --git a/mrbgems/mruby-array-ext/test/array.rb b/mrbgems/mruby-array-ext/test/array.rb index 66938f5e0..401d30a5e 100644 --- a/mrbgems/mruby-array-ext/test/array.rb +++ b/mrbgems/mruby-array-ext/test/array.rb @@ -260,6 +260,11 @@ assert("Array#bsearch") do assert_equal 4, a.bsearch{ |x| between( 0, x, 4) } assert_equal 4, a.bsearch{ |x| between( 4, x, 8) } assert_equal 8, a.bsearch{ |x| between( 5, x, 8) } + + # Invalid block result + assert_raise TypeError, 'invalid block result (must be numeric, true, false or nil)' do + a.bsearch{ 'I like to watch the world burn' } + end end assert("Array#delete_if") do -- cgit v1.2.3