From 78f540019a394421e1875cacaf956e8c23b18cc0 Mon Sep 17 00:00:00 2001 From: duerst Date: Tue, 29 Mar 2016 07:53:43 +0000 Subject: * enc/unicode/case-folding.rb, casefold.h: Tweaked handling of 6 special cases in CaseUnfold_11_Table. * enc/unicode.c: Adjustments for above. * test/ruby/enc/test_case_mapping.rb: Tests for the above: Some tests in test_titlecase activated; test_greek added. A test in test_cherokee fixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/enc/test_case_mapping.rb | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/ruby/enc/test_case_mapping.rb b/test/ruby/enc/test_case_mapping.rb index 5d028d9186..b52d86b57a 100644 --- a/test/ruby/enc/test_case_mapping.rb +++ b/test/ruby/enc/test_case_mapping.rb @@ -74,7 +74,7 @@ class TestCaseMappingPreliminary < Test::Unit::TestCase check_downcase_properties "\uab70\uab71\uab72\uab73\uab74\uab75\uab76\uab77\uab78\uab79", 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ', :lithuanian check_upcase_properties 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ', "\uab70\uab71\uab72\uab73\uab74\uab75\uab76\uab77\uab78\uab79", :lithuanian check_capitalize_suffixes "\uab70\uab71\uab72\uab73\uab74\uab75\uab76\uab77\uab78\uab79", 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ' - assert_equal 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ', 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ', :fold + assert_equal 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ', 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ'.downcase(:fold) assert_equal 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ', "\uab70\uab71\uab72\uab73\uab74\uab75\uab76\uab77\uab78\uab79".downcase(:fold) end @@ -82,15 +82,15 @@ class TestCaseMappingPreliminary < Test::Unit::TestCase check_downcase_properties 'dz dž lj nj', 'Dz Dž Lj Nj', :lithuanian check_downcase_properties 'dz dž lj nj', 'DZ DŽ LJ NJ', :lithuanian check_upcase_properties 'DZ DŽ LJ NJ', 'Dz Dž Lj Nj', :lithuanian - # check_upcase_properties 'DZ DŽ LJ NJ', 'dz dž lj nj', :lithuanian + check_upcase_properties 'DZ DŽ LJ NJ', 'dz dž lj nj', :lithuanian check_capitalize_properties 'Dz', 'DZ', :lithuanian check_capitalize_properties 'Dž', 'DŽ', :lithuanian check_capitalize_properties 'Lj', 'LJ', :lithuanian check_capitalize_properties 'Nj', 'NJ', :lithuanian - # check_capitalize_properties 'Dz', 'dz', :lithuanian - # check_capitalize_properties 'Dž', 'dž', :lithuanian - # check_capitalize_properties 'Lj', 'lj', :lithuanian - # check_capitalize_properties 'Nj', 'nj', :lithuanian + check_capitalize_properties 'Dz', 'dz', :lithuanian + check_capitalize_properties 'Dž', 'dž', :lithuanian + check_capitalize_properties 'Lj', 'lj', :lithuanian + check_capitalize_properties 'Nj', 'nj', :lithuanian end def test_ascii_option @@ -116,6 +116,11 @@ class TestCaseMappingPreliminary < Test::Unit::TestCase check_downcase_properties "yuki\u0307hi\u0307ro matsumoto (matz)", 'YUKİHİRO MATSUMOTO (MATZ)', :lithuanian end + def test_greek + check_downcase_properties 'αβγδεζηθικλμνξοπρστυφχψω', 'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ', :lithuanian + check_upcase_properties 'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ', 'αβγδεζηθικλμνξοπρστυφχψω', :lithuanian + end + def no_longer_a_test_buffer_allocations assert_equal 'TURKISH*ı'*10, ('I'*10).downcase(:turkic, :lithuanian) assert_equal 'TURKISH*ı'*100, ('I'*100).downcase(:turkic, :lithuanian) -- cgit v1.2.3