summaryrefslogtreecommitdiff
path: root/test/-ext-/num2int
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-01 11:58:55 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-01 11:58:55 +0000
commit0cbe2f4902aa3de9a082776d4fcc574bc50d5aa5 (patch)
treeedf823dcaa066728854f672fa0a77650cdb517e3 /test/-ext-/num2int
parent4e52c3c60c3b012631493d1ba6254d448e0eb7c5 (diff)
* ext/-test-/num2int/num2int.c: Return string for result, instead of
printing. * test/-ext-/num2int/test_num2int.rb: updated to follow above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-/num2int')
-rw-r--r--test/-ext-/num2int/test_num2int.rb22
1 files changed, 10 insertions, 12 deletions
diff --git a/test/-ext-/num2int/test_num2int.rb b/test/-ext-/num2int/test_num2int.rb
index f32d2a1..2add0f6 100644
--- a/test/-ext-/num2int/test_num2int.rb
+++ b/test/-ext-/num2int/test_num2int.rb
@@ -33,12 +33,11 @@ class TestNum2int < Test::Unit::TestCase
def assert_num2i_success_internal(exp, func, arg)
mesg = "#{func}(#{arg.inspect})"
- method = "print_#{func}".downcase
- out = err = nil
+ method = "rb_#{func}".downcase
+ out = nil
assert_nothing_raised(mesg) {
- out, err = capture_io { Num2int.send(method, arg) }
+ out = Num2int.send(method, arg)
}
- STDERR.puts err if err && !err.empty?
assert_equal(exp, out, mesg)
end
@@ -60,7 +59,7 @@ class TestNum2int < Test::Unit::TestCase
end
def assert_num2i_error_internal(func, arg)
- method = "print_#{func}".downcase
+ method = "rb_#{func}".downcase
assert_raise(RangeError, "#{func}(#{arg.inspect})") {
Num2int.send(method, arg)
}
@@ -85,12 +84,11 @@ class TestNum2int < Test::Unit::TestCase
def assert_fix2i_success_internal(exp, func, arg)
mesg = "#{func}(#{arg.inspect})"
- method = "print_#{func}".downcase
- out = err = nil
+ method = "rb_#{func}".downcase
+ out = nil
assert_nothing_raised(mesg) {
- out, err = capture_io { Num2int.send(method, arg) }
+ out = Num2int.send(method, arg)
}
- STDERR.puts err if err && !err.empty?
assert_equal(exp, out, mesg)
end
@@ -101,7 +99,7 @@ class TestNum2int < Test::Unit::TestCase
end
def assert_fix2i_error_internal(func, arg)
- method = "print_#{func}".downcase
+ method = "rb_#{func}".downcase
assert_raise(RangeError, "#{func}(#{arg.inspect})") {
Num2int.send(method, arg)
}
@@ -178,7 +176,7 @@ class TestNum2int < Test::Unit::TestCase
assert_num2i_success(:ll, FIXNUM_MIN-1)
assert_num2i_success(:ll, FIXNUM_MAX)
assert_num2i_success(:ll, FIXNUM_MAX+1)
- end if defined?(Num2int.print_num2ll)
+ end if defined?(Num2int.rb_num2ll)
def test_num2ull
assert_num2i_success(:ull, 0)
@@ -191,7 +189,7 @@ class TestNum2int < Test::Unit::TestCase
assert_num2i_success(:ull, FIXNUM_MIN-1, ULLONG_MAX-FIXNUM_MAX-1)
assert_num2i_success(:ull, FIXNUM_MAX)
assert_num2i_success(:ull, FIXNUM_MAX+1)
- end if defined?(Num2int.print_num2ull)
+ end if defined?(Num2int.rb_num2ull)
def test_fix2short
assert_fix2i_success(:short, 0)