summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-05 03:51:09 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-05 03:51:09 +0000
commite29e4b55ab79bd18550b11ce7d9cf94deca365be (patch)
tree2bdb6ff43327712631230572714711575d54434e /test
parent1677cbce9d7c72cca83d1b7d48cb85a17e74abcc (diff)
* range.c: Use div instead of / for bsearch
* test/ruby/test_range.rb: Test showing bug when requiring mathn git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_range.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb
index 1f370cfaee..0eb25480be 100644
--- a/test/ruby/test_range.rb
+++ b/test/ruby/test_range.rb
@@ -2,6 +2,7 @@ require 'test/unit'
require 'delegate'
require 'timeout'
require 'bigdecimal'
+require_relative 'envutil'
class TestRange < Test::Unit::TestCase
def test_range_string
@@ -535,4 +536,8 @@ class TestRange < Test::Unit::TestCase
assert_raise(TypeError) { ("a".."z").bsearch {} }
end
+
+ def test_bsearch_with_mathn
+ assert_in_out_err ['-r', 'mathn', '-e', 'puts (1..(1<<100)).bsearch{|x| raise "#{x} should be integer" unless x.integer?; x >= 42}'], "", ["42"], [], '[ruby-core:25740]'
+ end
end