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
This commit is contained in:
duerst 2018-12-10 23:12:12 +00:00
Родитель 6e99af1411
Коммит dff1e89bfb
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -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