1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

add tests againts regressions for upcoming codepoint reordering in unfolding table

* test/ruby/enc/test_case_mapping.rb: Add method test_reorder_unfold to test against
  problems when reordering codepoints in some entries in
  CaseUnfold_11_Type CaseUnfold_11_Table.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
duerst 2016-12-03 07:18:41 +00:00
parent fc410343a1
commit 0d2a4cc551

View file

@ -162,6 +162,31 @@ class TestCaseMappingPreliminary < Test::Unit::TestCase
check_upcase_properties 'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ', 'αβγδεζηθικλμνξοπρστυφχψω'
end
# This test checks against problems when changing the order of mapping results
# in some of the entries of the unfolding table (related to
# https://bugs.ruby-lang.org/issues/12990).
def test_reorder_unfold
# GREEK SMALL LETTER IOTA
assert_equal 0, "\u03B9" =~ /\u0345/i
assert_equal 0, "\u0345" =~ /\u03B9/i
assert_equal 0, "\u03B9" =~ /\u0399/i
assert_equal 0, "\u0399" =~ /\u03B9/i
assert_equal 0, "\u03B9" =~ /\u1fbe/i
assert_equal 0, "\u1fbe" =~ /\u03B9/i
# GREEK SMALL LETTER MU
assert_equal 0, "\u03BC" =~ /\u00B5/i
assert_equal 0, "\u00B5" =~ /\u03BC/i
assert_equal 0, "\u03BC" =~ /\u039C/i
assert_equal 0, "\u039C" =~ /\u03BC/i
# CYRILLIC SMALL LETTER MONOGRAPH UK
assert_equal 0, "\uA64B" =~ /\u1c88/i
assert_equal 0, "\u1c88" =~ /\uA64B/i
assert_equal 0, "\uA64B" =~ /\ua64A/i
assert_equal 0, "\ua64A" =~ /\uA64B/i
end
def no_longer_a_test_buffer_allocations
assert_equal 'TURKISH*ı'*10, ('I'*10).downcase(:turkic)
assert_equal 'TURKISH*ı'*100, ('I'*100).downcase(:turkic)