summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-13 00:02:34 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-13 00:02:34 +0000
commit19b5e818dd7191bd4a04d57582aa92e774f3f053 (patch)
tree6bd5a1ff55ea987e6810b5406f57cc7a5e09490d /test
parent0e292561756eae33f73d6ab93ee3ddb0aeab3dd2 (diff)
* enc/iso_8859_3.c, test/ruby/enc/test_case_comprehensive.rb:
Implement non-ASCII case conversion for ISO-8859-3, by Takuya Miyamoto. * test/ruby/enc/test_case_comprehensive.rb: Extend special treatment for Turkic. * enc/iso_8859_3.c: Exclude dotless i/I with dot from case-insensitive matching because they are not a case pair. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/enc/test_case_comprehensive.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/ruby/enc/test_case_comprehensive.rb b/test/ruby/enc/test_case_comprehensive.rb
index 9a5c17724d..8d202ca148 100644
--- a/test/ruby/enc/test_case_comprehensive.rb
+++ b/test/ruby/enc/test_case_comprehensive.rb
@@ -168,8 +168,15 @@ class TestComprehensiveCaseFold
begin
target = "#{test.first_data[code]}#{test.follow_data[code]*4}".encode(encoding)
rescue Encoding::UndefinedConversionError
- raise if code =~ /i|I/ # special case for Turkic
- target = source
+ if test.first_data[code]=="i\u0307" or test.follow_data[code]=="i\u0307" # explicit dot above
+ first_data = test.first_data[code]=="i\u0307" ? 'i' : test.first_data[code]
+ follow_data = test.follow_data[code]=="i\u0307" ? 'i' : test.follow_data[code]
+ target = "#{first_data}#{follow_data*4}".encode(encoding)
+ elsif code =~ /i|I/ # special case for Turkic
+ raise
+ else
+ target = source
+ end
end
result = source.send(test.method_name, *test.attributes)
assert_equal target, result,
@@ -244,7 +251,7 @@ class TestComprehensiveCaseFold
end
generate_ascii_only_case_mapping_tests 'ISO-8859-2'
- generate_ascii_only_case_mapping_tests 'ISO-8859-3'
+ generate_case_mapping_tests 'ISO-8859-3'
generate_case_mapping_tests 'ISO-8859-4'
generate_ascii_only_case_mapping_tests 'ISO-8859-5'
generate_ascii_only_case_mapping_tests 'ISO-8859-7'