ruby-changes:4758
From: ko1@a...
Date: Thu, 1 May 2008 21:47:36 +0900 (JST)
Subject: [ruby-changes:4758] matz - Ruby:r16252 (trunk): * test/ruby/test_parse.rb (TestParse::test_void_expr_stmts_value):
matz 2008-05-01 21:47:07 +0900 (Thu, 01 May 2008) New Revision: 16252 Modified files: trunk/ChangeLog trunk/rational.c trunk/test/ruby/test_parse.rb trunk/test/ruby/test_regexp.rb Log: * test/ruby/test_parse.rb (TestParse::test_void_expr_stmts_value): shut up warning. * rational.c (nurat_to_f): no need for forceful warning when converting to float. overflow is a nature of float values. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16252&r2=16251&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_regexp.rb?r1=16252&r2=16251&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/rational.c?r1=16252&r2=16251&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_parse.rb?r1=16252&r2=16251&diff_format=u Index: ChangeLog =================================================================== --- ChangeLog (revision 16251) +++ ChangeLog (revision 16252) @@ -1,3 +1,11 @@ +Thu May 1 20:31:09 2008 Yukihiro Matsumoto <matz@r...> + + * test/ruby/test_parse.rb (TestParse::test_void_expr_stmts_value): + shut up warning. + + * rational.c (nurat_to_f): no need for forceful warning when + converting to float. overflow is a nature of float values. + Thu May 1 16:10:21 2008 Nobuyoshi Nakada <nobu@r...> * hash.c (env_delete_if): return enumerator if no block given. Index: test/ruby/test_regexp.rb =================================================================== --- test/ruby/test_regexp.rb (revision 16251) +++ test/ruby/test_regexp.rb (revision 16252) @@ -250,10 +250,6 @@ assert_equal(["foo", "bar", "baz"], m.values_at(1, 2, 3)) end - def test_match_select - assert_equal(["ab", "a", "b"], /(.)(.)/.match("ab").select {|v| true }, "[ruby-dev:34556]") - end - def test_match_string m = /(?<x>b..)/.match("foobarbaz") assert_equal("foobarbaz", m.string) Index: test/ruby/test_parse.rb =================================================================== --- test/ruby/test_parse.rb (revision 16251) +++ test/ruby/test_parse.rb (revision 16252) @@ -1,4 +1,5 @@ require 'test/unit' +require 'stringio' class TestParse < Test::Unit::TestCase def setup @@ -762,6 +763,8 @@ # This test checks if void contexts are warned correctly. # Thus, warnings MUST NOT be suppressed. $VERBOSE = true + stderr = $stderr + $stderr = StringIO.new("") x = 1 assert_nil eval("x; nil") assert_nil eval("1+1; nil") @@ -785,6 +788,8 @@ x = def o.foo; end END end + assert_equal($stderr.string.lines.to_a.size, 14) + $stderr = stderr end def test_assign_in_conditional Index: rational.c =================================================================== --- rational.c (revision 16251) +++ rational.c (revision 16252) @@ -1130,7 +1130,7 @@ e = (int)(ne - de); if ((e > DBL_MAX_EXP) || (e < DBL_MIN_EXP)) { - rb_warn("%s out of Float range", rb_obj_classname(self)); + rb_warning("%s out of Float range", rb_obj_classname(self)); return rb_float_new(e > 0 ? HUGE_VAL : 0.0); } @@ -1140,7 +1140,7 @@ f = ldexp(f, e); if (isinf(f) || isnan(f)) - rb_warn("%s out of Float range", rb_obj_classname(self)); + rb_warning("%s out of Float range", rb_obj_classname(self)); return rb_float_new(f); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/