diff options
author | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-10 23:12:12 +0000 |
---|---|---|
committer | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-10 23:12:12 +0000 |
commit | dff1e89bfb77e5d57bc56312364ac2036f3f7a99 (patch) | |
tree | 906e8561763f16369b9ad27ecca2466b8b97a83a | |
parent | 6e99af1411467681c739725c9c744da4b57a7eee (diff) | |
download | ruby-dff1e89bfb77e5d57bc56312364ac2036f3f7a99.tar.gz |
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
-rw-r--r-- | test/ruby/enc/test_case_mapping.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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 |