1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2016-06-14 15:01:37 +00:00
parent 8f7ddbb0ec
commit fb1cee9b6f
2 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,9 @@
Wed Jun 15 00:01:18 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* 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@ruby-lang.org>
* include/ruby/backward.h (rb_cFixnum, rb_cBignum): remove the

View file

@ -50,10 +50,10 @@ class TestComprehensiveCaseFold < Test::Unit::TestCase
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