ruby-changes:31026
From: nobu <ko1@a...>
Date: Tue, 1 Oct 2013 16:27:24 +0900 (JST)
Subject: [ruby-changes:31026] nobu:r43105 (trunk): test_regexp.rb, test_string.rb: suppress warnings
nobu 2013-10-01 16:27:14 +0900 (Tue, 01 Oct 2013) New Revision: 43105 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43105 Log: test_regexp.rb, test_string.rb: suppress warnings Modified files: trunk/test/ruby/test_regexp.rb trunk/test/ruby/test_string.rb Index: test/ruby/test_regexp.rb =================================================================== --- test/ruby/test_regexp.rb (revision 43104) +++ test/ruby/test_regexp.rb (revision 43105) @@ -380,7 +380,7 @@ class TestRegexp < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_regexp.rb#L380 assert_equal(/a/, eval(%q(s="\u0061";/#{s}/n))) assert_raise(RegexpError) { s = "\u3042"; eval(%q(/#{s}/n)) } assert_raise(RegexpError) { s = "\u0061"; eval(%q(/\u3042#{s}/n)) } - assert_raise(RegexpError) { s1=[0xff].pack("C"); s2="\u3042"; eval(%q(/#{s1}#{s2}/)) } + assert_raise(RegexpError) { s1=[0xff].pack("C"); s2="\u3042"; eval(%q(/#{s1}#{s2}/)); [s1, s2] } assert_raise(ArgumentError) { s = '\x'; /#{ s }/ } @@ -593,7 +593,7 @@ class TestRegexp < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_regexp.rb#L593 check(/\A\80\z/, "80", ["\100", ""]) check(/\A\77\z/, "?") check(/\A\78\z/, "\7" + '8', ["\100", ""]) - check(/\A\Qfoo\E\z/, "QfooE") + check(eval('/\A\Qfoo\E\z/'), "QfooE") check(/\Aa++\z/, "aaa") check('\Ax]\z', "x]") check(/x#foo/x, "x", "#foo") @@ -767,9 +767,9 @@ class TestRegexp < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_regexp.rb#L767 def test_posix_bracket check(/\A[[:alpha:]0]\z/, %w(0 a), %w(1 .)) - check(/\A[[:^alpha:]0]\z/, %w(0 1 .), "a") - check(/\A[[:alpha\:]]\z/, %w(a l p h a :), %w(b 0 1 .)) - check(/\A[[:alpha:foo]0]\z/, %w(0 a), %w(1 .)) + check(eval('/\A[[:^alpha:]0]\z/'), %w(0 1 .), "a") + check(eval('/\A[[:alpha\:]]\z/'), %w(a l p h a :), %w(b 0 1 .)) + check(eval('/\A[[:alpha:foo]0]\z/'), %w(0 a), %w(1 .)) check(/\A[[:xdigit:]&&[:alpha:]]\z/, "a", %w(g 0)) check('\A[[:abcdefghijklmnopqrstu:]]+\z', "[]") failcheck('[[:alpha') @@ -1003,7 +1003,7 @@ class TestRegexp < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_regexp.rb#L1003 # escape pr4 = proc{|i| catch(:xyzzy){ - /#{throw :xyzzy, i}/o + /#{throw :xyzzy, i}/o =~ "" :ng } } Index: test/ruby/test_string.rb =================================================================== --- test/ruby/test_string.rb (revision 43104) +++ test/ruby/test_string.rb (revision 43105) @@ -2189,8 +2189,8 @@ class TestString < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L2189 assert_equal(u("\x82")+("\u3042"*9), ("\u3042"*10).byteslice(2, 28)) bug7954 = '[ruby-dev:47108]' - assert_equal(false, "\u3042".byteslice(0, 2).valid_encoding?) - assert_equal(false, ("\u3042"*10).byteslice(0, 20).valid_encoding?) + assert_equal(false, "\u3042".byteslice(0, 2).valid_encoding?, bug7954) + assert_equal(false, ("\u3042"*10).byteslice(0, 20).valid_encoding?, bug7954) end def test_unknown_string_option -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/