summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-array-ext/test/array.rb
diff options
context:
space:
mode:
authorChristopher Aue <[email protected]>2017-07-28 17:02:36 +0200
committerChristopher Aue <[email protected]>2017-07-28 23:51:40 +0200
commit451574f1420d8533f44a06d9aca23b5647292228 (patch)
tree9d298926a859fbd9733e3dceed37166780ecd0e1 /mrbgems/mruby-array-ext/test/array.rb
parent8a6ce74b4d33b804edd4d2bb281a45a414bcc62f (diff)
downloadmruby-451574f1420d8533f44a06d9aca23b5647292228.tar.gz
mruby-451574f1420d8533f44a06d9aca23b5647292228.zip
Refactored Array#bsearch
Diffstat (limited to 'mrbgems/mruby-array-ext/test/array.rb')
-rw-r--r--mrbgems/mruby-array-ext/test/array.rb5
1 files changed, 5 insertions, 0 deletions
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