ruby-changes:54093
From: duerst <ko1@a...>
Date: Tue, 11 Dec 2018 08:12:19 +0900 (JST)
Subject: [ruby-changes:54093] duerst:r66314 (trunk): add a test to make sure some unassigned codepoints do not get converted
duerst 2018-12-11 08:12:12 +0900 (Tue, 11 Dec 2018) New Revision: 66314 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66314 Log: add a test to make sure some unassigned codepoints do not get converted In test/ruby/enc/test_case_mapping.rb, add a test to make sure the unassigned codepoints in the Georgian MTAVRULI range (U+1CBB, U+1CBC) do not get converted to unrelated codepoints by String#capitalize. (It turns out that this test was not strictly necessary, because unassigned codepoints are already excluded by the fact that they are not found in the onigenc_unicode_fold_lookup table. So this test only serves to check against future regressions.) Modified files: trunk/test/ruby/enc/test_case_mapping.rb Index: test/ruby/enc/test_case_mapping.rb =================================================================== --- test/ruby/enc/test_case_mapping.rb (revision 66313) +++ test/ruby/enc/test_case_mapping.rb (revision 66314) @@ -193,6 +193,12 @@ class TestCaseMappingPreliminary < Test: https://github.com/ruby/ruby/blob/trunk/test/ruby/enc/test_case_mapping.rb#L193 assert_equal false, "\u1CBC".match?(/\p{assigned}/), message end + def test_georgian_unassigned + message = "Unassigned codepoints should not be converted" + assert_equal "\u1CBB", "\u1CBB".capitalize, message + assert_equal "\u1CBC", "\u1CBC".capitalize, message + end + def test_georgian_capitalize assert_equal "\u10D0\u10D1\u10D2", "\u1C90\u1C91\u1C92".capitalize assert_equal "\u10D0\u10D1\u10D2", "\u1C90\u1C91\u10D2".capitalize -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/