From dff1e89bfb77e5d57bc56312364ac2036f3f7a99 Mon Sep 17 00:00:00 2001 From: duerst Date: Mon, 10 Dec 2018 23:12:12 +0000 Subject: 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.) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/enc/test_case_mapping.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby/enc') diff --git a/test/ruby/enc/test_case_mapping.rb b/test/ruby/enc/test_case_mapping.rb index 984fd5d479..aa20531783 100644 --- a/test/ruby/enc/test_case_mapping.rb +++ b/test/ruby/enc/test_case_mapping.rb @@ -193,6 +193,12 @@ class TestCaseMappingPreliminary < Test::Unit::TestCase 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 -- cgit v1.2.3