summaryrefslogtreecommitdiff
path: root/test/ruby/enc/test_case_comprehensive.rb
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-14 15:01:37 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-14 15:01:37 +0000
commitfb1cee9b6fd8e02aa270b1944dbd7841a917064f (patch)
tree181ec4593a51f0e16ff40987b83fe086495389b2 /test/ruby/enc/test_case_comprehensive.rb
parent8f7ddbb0ec0b13bf81c98809ae8f9f44ed9d395d (diff)
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
Diffstat (limited to 'test/ruby/enc/test_case_comprehensive.rb')
-rw-r--r--test/ruby/enc/test_case_comprehensive.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/ruby/enc/test_case_comprehensive.rb b/test/ruby/enc/test_case_comprehensive.rb
index ece4f1b980..f8ee0529e1 100644
--- a/test/ruby/enc/test_case_comprehensive.rb
+++ b/test/ruby/enc/test_case_comprehensive.rb
@@ -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