[前][次][番号順一覧][スレッド一覧]

ruby-changes:43341

From: kazu <ko1@a...>
Date: Wed, 15 Jun 2016 00:01:41 +0900 (JST)
Subject: [ruby-changes:43341] kazu:r55415 (trunk): use \A and \z instead of ^ and $ in regexp

kazu	2016-06-15 00:01:37 +0900 (Wed, 15 Jun 2016)

  New Revision: 55415

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55415

  Log:
    use \A and \z instead of ^ and $ in regexp
    
    * test/ruby/enc/test_case_comprehensive.rb
      (TestComprehensiveCaseFold::read_data): use \A and \z instead of
      ^ and $ in regexp.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/enc/test_case_comprehensive.rb
Index: test/ruby/enc/test_case_comprehensive.rb
===================================================================
--- test/ruby/enc/test_case_comprehensive.rb	(revision 55414)
+++ test/ruby/enc/test_case_comprehensive.rb	(revision 55415)
@@ -50,10 +50,10 @@ class TestComprehensiveCaseFold < Test:: https://github.com/ruby/ruby/blob/trunk/test/ruby/enc/test_case_comprehensive.rb#L50
     turkic_downcase  = Hash.new { |h, c| h[c] = downcase[c] }
     turkic_titlecase = Hash.new { |h, c| h[c] = titlecase[c] }
     turkic_swapcase  = Hash.new { |h, c| h[c] = swapcase[c] }
-    ascii_upcase     = Hash.new { |h, c| h[c] = c =~ /^[a-zA-Z]$/ ? upcase[c] : c }
-    ascii_downcase   = Hash.new { |h, c| h[c] = c =~ /^[a-zA-Z]$/ ? downcase[c] : c }
-    ascii_titlecase  = Hash.new { |h, c| h[c] = c =~ /^[a-zA-Z]$/ ? titlecase[c] : c }
-    ascii_swapcase   = Hash.new { |h, c| h[c] = c=~/^[a-z]$/ ? upcase[c] : (c=~/^[A-Z]$/ ? downcase[c] : c) }
+    ascii_upcase     = Hash.new { |h, c| h[c] = c =~ /\A[a-zA-Z]\z/ ? upcase[c] : c }
+    ascii_downcase   = Hash.new { |h, c| h[c] = c =~ /\A[a-zA-Z]\z/ ? downcase[c] : c }
+    ascii_titlecase  = Hash.new { |h, c| h[c] = c =~ /\A[a-zA-Z]\z/ ? titlecase[c] : c }
+    ascii_swapcase   = Hash.new { |h, c| h[c] = c=~/\A[a-z]\z/ ? upcase[c] : (c=~/\A[A-Z]\z/ ? downcase[c] : c) }
 
     read_data_file('UnicodeData') do |code, data|
       @@codepoints << code
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55414)
+++ ChangeLog	(revision 55415)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jun 15 00:01:18 2016  Kazuhiro NISHIYAMA  <zn@m...>
+
+	* test/ruby/enc/test_case_comprehensive.rb
+	  (TestComprehensiveCaseFold::read_data): use \A and \z instead of
+	  ^ and $ in regexp.
+
 Tue Jun 14 23:43:00 2016  Nobuyoshi Nakada  <nobu@r...>
 
 	* include/ruby/backward.h (rb_cFixnum, rb_cBignum): remove the

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]