ruby-changes:54606
From: naruse <ko1@a...>
Date: Tue, 15 Jan 2019 12:43:51 +0900 (JST)
Subject: [ruby-changes:54606] naruse:r66821 (trunk): Suppress warning: ambiguous first argument; put parentheses or a space even after `/' operator
naruse 2019-01-15 12:43:44 +0900 (Tue, 15 Jan 2019) New Revision: 66821 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66821 Log: Suppress warning: ambiguous first argument; put parentheses or a space even after `/' operator Modified files: trunk/test/ruby/test_regexp.rb Index: test/ruby/test_regexp.rb =================================================================== --- test/ruby/test_regexp.rb (revision 66820) +++ test/ruby/test_regexp.rb (revision 66821) @@ -950,24 +950,24 @@ class TestRegexp < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_regexp.rb#L950 end def test_cclass_R - assert_match /\A\R\z/, "\r" - assert_match /\A\R\z/, "\n" - assert_match /\A\R\z/, "\r\n" + assert_match(/\A\R\z/, "\r") + assert_match(/\A\R\z/, "\n") + assert_match(/\A\R\z/, "\r\n") end def test_cclass_X - assert_match /\A\X\z/, "\u{20 200d}" - assert_match /\A\X\z/, "\u{600 600}" - assert_match /\A\X\z/, "\u{600 20}" - assert_match /\A\X\z/, "\u{261d 1F3FB}" - assert_match /\A\X\z/, "\u{1f600}" - assert_match /\A\X\z/, "\u{20 324}" - assert_match /\A\X\X\z/, "\u{a 324}" - assert_match /\A\X\X\z/, "\u{d 324}" - assert_match /\A\X\z/, "\u{1F477 1F3FF 200D 2640 FE0F}" - assert_match /\A\X\z/, "\u{1F468 200D 1F393}" - assert_match /\A\X\z/, "\u{1F46F 200D 2642 FE0F}" - assert_match /\A\X\z/, "\u{1f469 200d 2764 fe0f 200d 1f469}" + assert_match(/\A\X\z/, "\u{20 200d}") + assert_match(/\A\X\z/, "\u{600 600}") + assert_match(/\A\X\z/, "\u{600 20}") + assert_match(/\A\X\z/, "\u{261d 1F3FB}") + assert_match(/\A\X\z/, "\u{1f600}") + assert_match(/\A\X\z/, "\u{20 324}") + assert_match(/\A\X\X\z/, "\u{a 324}") + assert_match(/\A\X\X\z/, "\u{d 324}") + assert_match(/\A\X\z/, "\u{1F477 1F3FF 200D 2640 FE0F}") + assert_match(/\A\X\z/, "\u{1F468 200D 1F393}") + assert_match(/\A\X\z/, "\u{1F46F 200D 2642 FE0F}") + assert_match(/\A\X\z/, "\u{1f469 200d 2764 fe0f 200d 1f469}") assert_warning('') {/\X/ =~ "\u{a0}"} end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/