aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--test/ruby/envutil.rb12
-rw-r--r--test/ruby/test_float.rb7
-rw-r--r--version.h4
4 files changed, 24 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index c4d2ac553c..4f0483a8e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sun Jul 25 05:26:23 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/envutil.rb (EnvUtil#.suppress_warning): added.
+
+ * test/ruby/test_float.rb (TestFloat#test_Float): suppress
+ warnings under --verbose.
+
Fri Jul 23 16:07:32 2010 Shugo Maeda <shugo@ruby-lang.org>
* lib/mutex_m.rb (sleep): added Mutex_m#sleep to support
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb
index 978bf770bf..0d5632d4d9 100644
--- a/test/ruby/envutil.rb
+++ b/test/ruby/envutil.rb
@@ -100,6 +100,14 @@ module EnvUtil
end
module_function :verbose_warning
+ def suppress_warning
+ verbose, $VERBOSE = $VERBOSE, nil
+ yield
+ ensure
+ $VERBOSE = verbose
+ end
+ module_function :suppress_warning
+
def under_gc_stress
stress, GC.stress = GC.stress, true
yield
@@ -114,7 +122,7 @@ module Test
module Assertions
public
def assert_normal_exit(testsrc, message = '', opt = {})
- stdout, stderr, status = EnvUtil.invoke_ruby(%W'-W0', testsrc, true, true, opt)
+ _, _, status = EnvUtil.invoke_ruby(%W'-W0', testsrc, true, true, opt)
pid = status.pid
faildesc = proc do
signo = status.termsig
@@ -161,7 +169,7 @@ module Test
end
def assert_ruby_status(args, test_stdin="", message=nil, opt={})
- stdout, stderr, status = EnvUtil.invoke_ruby(args, test_stdin, false, false, opt)
+ _, _, status = EnvUtil.invoke_ruby(args, test_stdin, false, false, opt)
m = message ? "#{message} (#{status.inspect})" : "ruby exit status is not success: #{status.inspect}"
assert(status.success?, m)
end
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb
index 03d9c94766..5f3e98a6fd 100644
--- a/test/ruby/test_float.rb
+++ b/test/ruby/test_float.rb
@@ -1,6 +1,9 @@
require 'test/unit'
+require_relative 'envutil'
class TestFloat < Test::Unit::TestCase
+ include EnvUtil
+
def test_float
assert_equal(2, 2.6.floor)
assert_equal(-3, (-2.6).floor)
@@ -426,10 +429,10 @@ class TestFloat < Test::Unit::TestCase
def test_Float
assert_in_delta(0.125, Float("0.1_2_5"), 0.00001)
assert_in_delta(0.125, "0.1_2_5__".to_f, 0.00001)
- assert_equal(1, Float(([1] * 10000).join).infinite?)
+ assert_equal(1, suppress_warning {Float(([1] * 10000).join)}.infinite?)
assert(!Float(([1] * 10000).join("_")).infinite?) # is it really OK?
assert_raise(ArgumentError) { Float("1.0\x001") }
- assert_equal(1, Float("1e10_00").infinite?)
+ assert_equal(1, suppress_warning {Float("1e10_00")}.infinite?)
assert_raise(TypeError) { Float(nil) }
o = Object.new
def o.to_f; inf = Float::INFINITY; inf/inf; end
diff --git a/version.h b/version.h
index b8b86006c3..53d8521567 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.3"
-#define RUBY_RELEASE_DATE "2010-07-24"
+#define RUBY_RELEASE_DATE "2010-07-25"
#define RUBY_PATCHLEVEL -1
#define RUBY_BRANCH_NAME "trunk"
@@ -8,7 +8,7 @@
#define RUBY_VERSION_TEENY 1
#define RUBY_RELEASE_YEAR 2010
#define RUBY_RELEASE_MONTH 7
-#define RUBY_RELEASE_DAY 24
+#define RUBY_RELEASE_DAY 25
#include "ruby/version.h"