mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/enc/test_case_mapping.rb:
Remove :lithuanian guard for Unicode case mapping. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9d2196fd95
commit
b09795d803
2 changed files with 64 additions and 59 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Mon Jun 6 13:16:46 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||||
|
|
||||||
|
* test/ruby/enc/test_case_mapping.rb:
|
||||||
|
Remove :lithuanian guard for Unicode case mapping.
|
||||||
|
|
||||||
Mon Jun 6 10:39:56 2016 Kazuki Yamaguchi <k@rhe.jp>
|
Mon Jun 6 10:39:56 2016 Kazuki Yamaguchi <k@rhe.jp>
|
||||||
|
|
||||||
* ext/openssl/openssl_missing.h: Include ruby/config.h. r55285 added
|
* ext/openssl/openssl_missing.h: Include ruby/config.h. r55285 added
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require "test/unit"
|
require "test/unit"
|
||||||
|
|
||||||
# preliminary tests, using :lithuanian as a guard
|
# preliminary tests, using as a guard
|
||||||
# to test new implementation strategy
|
# to test new implementation strategy
|
||||||
class TestCaseMappingPreliminary < Test::Unit::TestCase
|
class TestCaseMappingPreliminary < Test::Unit::TestCase
|
||||||
# checks, including idempotence and non-modification; not always guaranteed
|
# checks, including idempotence and non-modification; not always guaranteed
|
||||||
|
@ -39,7 +39,7 @@ class TestCaseMappingPreliminary < Test::Unit::TestCase
|
||||||
def check_capitalize_suffixes(lower, upper)
|
def check_capitalize_suffixes(lower, upper)
|
||||||
while upper.length > 1
|
while upper.length > 1
|
||||||
lower = lower[1..-1]
|
lower = lower[1..-1]
|
||||||
check_capitalize_properties upper[0]+lower, upper, :lithuanian
|
check_capitalize_properties upper[0]+lower, upper
|
||||||
upper = upper[1..-1]
|
upper = upper[1..-1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -54,10 +54,10 @@ class TestCaseMappingPreliminary < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_ascii
|
def test_ascii
|
||||||
check_downcase_properties 'yukihiro matsumoto (matz)', 'Yukihiro MATSUMOTO (MATZ)', :lithuanian
|
check_downcase_properties 'yukihiro matsumoto (matz)', 'Yukihiro MATSUMOTO (MATZ)'
|
||||||
check_upcase_properties 'YUKIHIRO MATSUMOTO (MATZ)', 'yukihiro matsumoto (matz)', :lithuanian
|
check_upcase_properties 'YUKIHIRO MATSUMOTO (MATZ)', 'yukihiro matsumoto (matz)'
|
||||||
check_capitalize_properties 'Yukihiro matsumoto (matz)', 'yukihiro MATSUMOTO (MATZ)', :lithuanian
|
check_capitalize_properties 'Yukihiro matsumoto (matz)', 'yukihiro MATSUMOTO (MATZ)'
|
||||||
check_swapcase_properties 'yUKIHIRO matsumoto (MAtz)', 'Yukihiro MATSUMOTO (maTZ)', :lithuanian
|
check_swapcase_properties 'yUKIHIRO matsumoto (MAtz)', 'Yukihiro MATSUMOTO (maTZ)'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_invalid
|
def test_invalid
|
||||||
|
@ -68,70 +68,70 @@ class TestCaseMappingPreliminary < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_general
|
def test_general
|
||||||
check_downcase_properties 'résumé dürst ĭñŧėřŋãţijňőńæłĩżàťïōņ', 'RÉSUMÉ DÜRST ĬÑŦĖŘŊÃŢIJŇŐŃÆŁĨŻÀŤÏŌŅ', :lithuanian
|
check_downcase_properties 'résumé dürst ĭñŧėřŋãţijňőńæłĩżàťïōņ', 'RÉSUMÉ DÜRST ĬÑŦĖŘŊÃŢIJŇŐŃÆŁĨŻÀŤÏŌŅ'
|
||||||
check_upcase_properties 'RÉSUMÉ DÜRST ĬÑŦĖŘŊÃŢIJŇŐŃÆŁĨŻÀŤÏŌŅ', 'résumé dürst ĭñŧėřŋãţijňőńæłĩżàťïōņ', :lithuanian
|
check_upcase_properties 'RÉSUMÉ DÜRST ĬÑŦĖŘŊÃŢIJŇŐŃÆŁĨŻÀŤÏŌŅ', 'résumé dürst ĭñŧėřŋãţijňőńæłĩżàťïōņ'
|
||||||
check_capitalize_suffixes 'résumé dürst ĭñŧėřŋãţijňőńæłĩżàťïōņ', 'RÉSUMÉ DÜRST ĬÑŦĖŘŊÃŢIJŇŐŃÆŁĨŻÀŤÏŌŅ'
|
check_capitalize_suffixes 'résumé dürst ĭñŧėřŋãţijňőńæłĩżàťïōņ', 'RÉSUMÉ DÜRST ĬÑŦĖŘŊÃŢIJŇŐŃÆŁĨŻÀŤÏŌŅ'
|
||||||
check_swapcase_properties 'résumé DÜRST ĭñŧėřŊÃŢIJŇŐŃæłĩżàťïōņ', 'RÉSUMÉ dürst ĬÑŦĖŘŋãţijňőńÆŁĨŻÀŤÏŌŅ', :lithuanian
|
check_swapcase_properties 'résumé DÜRST ĭñŧėřŊÃŢIJŇŐŃæłĩżàťïōņ', 'RÉSUMÉ dürst ĬÑŦĖŘŋãţijňőńÆŁĨŻÀŤÏŌŅ'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_one_way_upcase
|
def test_one_way_upcase
|
||||||
check_upcase_properties 'ΜΜΜΜΜ', 'µµµµµ', :lithuanian # MICRO SIGN -> Greek Mu
|
check_upcase_properties 'ΜΜΜΜΜ', 'µµµµµ' # MICRO SIGN -> Greek Mu
|
||||||
check_downcase_properties 'µµµµµ', 'µµµµµ', :lithuanian # MICRO SIGN -> Greek Mu
|
check_downcase_properties 'µµµµµ', 'µµµµµ' # MICRO SIGN -> Greek Mu
|
||||||
check_capitalize_properties 'Μµµµµ', 'µµµµµ', :lithuanian # MICRO SIGN -> Greek Mu
|
check_capitalize_properties 'Μµµµµ', 'µµµµµ' # MICRO SIGN -> Greek Mu
|
||||||
check_capitalize_properties 'Μµµµµ', 'µµµµµ', :turkic # MICRO SIGN -> Greek Mu
|
check_capitalize_properties 'Μµµµµ', 'µµµµµ', :turkic # MICRO SIGN -> Greek Mu
|
||||||
check_capitalize_properties 'H̱ẖẖẖẖ', 'ẖẖẖẖẖ', :lithuanian
|
check_capitalize_properties 'H̱ẖẖẖẖ', 'ẖẖẖẖẖ'
|
||||||
check_capitalize_properties 'Βϐϐϐϐ', 'ϐϐϐϐϐ', :lithuanian
|
check_capitalize_properties 'Βϐϐϐϐ', 'ϐϐϐϐϐ'
|
||||||
check_capitalize_properties 'Θϑϑϑϑ', 'ϑϑϑϑϑ', :lithuanian
|
check_capitalize_properties 'Θϑϑϑϑ', 'ϑϑϑϑϑ'
|
||||||
check_capitalize_properties 'Φϕ', 'ϕϕ', :lithuanian
|
check_capitalize_properties 'Φϕ', 'ϕϕ'
|
||||||
check_capitalize_properties 'Πϖ', 'ϖϖ', :lithuanian
|
check_capitalize_properties 'Πϖ', 'ϖϖ'
|
||||||
check_capitalize_properties 'Κϰ', 'ϰϰ', :lithuanian
|
check_capitalize_properties 'Κϰ', 'ϰϰ'
|
||||||
check_capitalize_properties 'Ρϱϱ', 'ϱϱϱ', :lithuanian
|
check_capitalize_properties 'Ρϱϱ', 'ϱϱϱ'
|
||||||
check_capitalize_properties 'Εϵ', 'ϵϵ', :lithuanian
|
check_capitalize_properties 'Εϵ', 'ϵϵ'
|
||||||
check_capitalize_properties 'Ιͅͅͅͅ', 'ͅͅͅͅͅ', :lithuanian
|
check_capitalize_properties 'Ιͅͅͅͅ', 'ͅͅͅͅͅ'
|
||||||
check_capitalize_properties 'Sſſſſ', 'ſſſſſ', :lithuanian
|
check_capitalize_properties 'Sſſſſ', 'ſſſſſ'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_various
|
def test_various
|
||||||
check_upcase_properties 'Μ', 'µ', :lithuanian # MICRO SIGN -> Greek Mu
|
check_upcase_properties 'Μ', 'µ' # MICRO SIGN -> Greek Mu
|
||||||
check_downcase_properties 'µµµµµ', 'µµµµµ', :lithuanian # MICRO SIGN
|
check_downcase_properties 'µµµµµ', 'µµµµµ' # MICRO SIGN
|
||||||
check_capitalize_properties 'Ss', 'ß', :lithuanian
|
check_capitalize_properties 'Ss', 'ß'
|
||||||
check_upcase_properties 'SS', 'ß', :lithuanian
|
check_upcase_properties 'SS', 'ß'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_cherokee
|
def test_cherokee
|
||||||
check_downcase_properties "\uab70\uab71\uab72\uab73\uab74\uab75\uab76\uab77\uab78\uab79", 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ', :lithuanian
|
check_downcase_properties "\uab70\uab71\uab72\uab73\uab74\uab75\uab76\uab77\uab78\uab79", 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ'
|
||||||
check_upcase_properties 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ', "\uab70\uab71\uab72\uab73\uab74\uab75\uab76\uab77\uab78\uab79", :lithuanian
|
check_upcase_properties 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ', "\uab70\uab71\uab72\uab73\uab74\uab75\uab76\uab77\uab78\uab79"
|
||||||
check_capitalize_suffixes "\uab70\uab71\uab72\uab73\uab74\uab75\uab76\uab77\uab78\uab79", 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ'
|
check_capitalize_suffixes "\uab70\uab71\uab72\uab73\uab74\uab75\uab76\uab77\uab78\uab79", 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ'
|
||||||
assert_equal 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ', 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ'.downcase(:fold)
|
assert_equal 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ', 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ'.downcase(:fold)
|
||||||
assert_equal 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ', "\uab70\uab71\uab72\uab73\uab74\uab75\uab76\uab77\uab78\uab79".downcase(:fold)
|
assert_equal 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ', "\uab70\uab71\uab72\uab73\uab74\uab75\uab76\uab77\uab78\uab79".downcase(:fold)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_titlecase
|
def test_titlecase
|
||||||
check_downcase_properties 'dz dž lj nj', 'Dz Dž Lj Nj', :lithuanian
|
check_downcase_properties 'dz dž lj nj', 'Dz Dž Lj Nj'
|
||||||
check_downcase_properties 'dz dž lj nj', 'DZ DŽ LJ NJ', :lithuanian
|
check_downcase_properties 'dz dž lj nj', 'DZ DŽ LJ NJ'
|
||||||
check_upcase_properties 'DZ DŽ LJ NJ', 'Dz Dž Lj Nj', :lithuanian
|
check_upcase_properties 'DZ DŽ LJ NJ', 'Dz Dž Lj Nj'
|
||||||
check_upcase_properties 'DZ DŽ LJ NJ', 'dz dž lj nj', :lithuanian
|
check_upcase_properties 'DZ DŽ LJ NJ', 'dz dž lj nj'
|
||||||
check_capitalize_properties 'Dz', 'DZ', :lithuanian
|
check_capitalize_properties 'Dz', 'DZ'
|
||||||
check_capitalize_properties 'Dž', 'DŽ', :lithuanian
|
check_capitalize_properties 'Dž', 'DŽ'
|
||||||
check_capitalize_properties 'Lj', 'LJ', :lithuanian
|
check_capitalize_properties 'Lj', 'LJ'
|
||||||
check_capitalize_properties 'Nj', 'NJ', :lithuanian
|
check_capitalize_properties 'Nj', 'NJ'
|
||||||
check_capitalize_properties 'Dz', 'dz', :lithuanian
|
check_capitalize_properties 'Dz', 'dz'
|
||||||
check_capitalize_properties 'Dž', 'dž', :lithuanian
|
check_capitalize_properties 'Dž', 'dž'
|
||||||
check_capitalize_properties 'Lj', 'lj', :lithuanian
|
check_capitalize_properties 'Lj', 'lj'
|
||||||
check_capitalize_properties 'Nj', 'nj', :lithuanian
|
check_capitalize_properties 'Nj', 'nj'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_swapcase
|
def test_swapcase
|
||||||
assert_equal 'dZ', 'Dz'.swapcase(:lithuanian)
|
assert_equal 'dZ', 'Dz'.swapcase
|
||||||
assert_equal 'dŽ', 'Dž'.swapcase(:lithuanian)
|
assert_equal 'dŽ', 'Dž'.swapcase
|
||||||
assert_equal 'lJ', 'Lj'.swapcase(:lithuanian)
|
assert_equal 'lJ', 'Lj'.swapcase
|
||||||
assert_equal 'nJ', 'Nj'.swapcase(:lithuanian)
|
assert_equal 'nJ', 'Nj'.swapcase
|
||||||
assert_equal 'ἀΙ', 'ᾈ'.swapcase(:lithuanian)
|
assert_equal 'ἀΙ', 'ᾈ'.swapcase
|
||||||
assert_equal 'ἣΙ', 'ᾛ'.swapcase(:lithuanian)
|
assert_equal 'ἣΙ', 'ᾛ'.swapcase
|
||||||
assert_equal 'ὧΙ', 'ᾯ'.swapcase(:lithuanian)
|
assert_equal 'ὧΙ', 'ᾯ'.swapcase
|
||||||
assert_equal 'αΙ', 'ᾼ'.swapcase(:lithuanian)
|
assert_equal 'αΙ', 'ᾼ'.swapcase
|
||||||
assert_equal 'ηΙ', 'ῌ'.swapcase(:lithuanian)
|
assert_equal 'ηΙ', 'ῌ'.swapcase
|
||||||
assert_equal 'ωΙ', 'ῼ'.swapcase(:lithuanian)
|
assert_equal 'ωΙ', 'ῼ'.swapcase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_ascii_option
|
def test_ascii_option
|
||||||
|
@ -154,20 +154,20 @@ class TestCaseMappingPreliminary < Test::Unit::TestCase
|
||||||
def test_turcic
|
def test_turcic
|
||||||
check_downcase_properties 'yukihiro matsumoto (matz)', 'Yukihiro MATSUMOTO (MATZ)', :turkic
|
check_downcase_properties 'yukihiro matsumoto (matz)', 'Yukihiro MATSUMOTO (MATZ)', :turkic
|
||||||
check_upcase_properties 'YUKİHİRO MATSUMOTO (MATZ)', 'Yukihiro Matsumoto (matz)', :turkic
|
check_upcase_properties 'YUKİHİRO MATSUMOTO (MATZ)', 'Yukihiro Matsumoto (matz)', :turkic
|
||||||
check_downcase_properties "yuki\u0307hi\u0307ro matsumoto (matz)", 'YUKİHİRO MATSUMOTO (MATZ)', :lithuanian
|
check_downcase_properties "yuki\u0307hi\u0307ro matsumoto (matz)", 'YUKİHİRO MATSUMOTO (MATZ)'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_greek
|
def test_greek
|
||||||
check_downcase_properties 'αβγδεζηθικλμνξοπρστυφχψω', 'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ', :lithuanian
|
check_downcase_properties 'αβγδεζηθικλμνξοπρστυφχψω', 'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ'
|
||||||
check_upcase_properties 'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ', 'αβγδεζηθικλμνξοπρστυφχψω', :lithuanian
|
check_upcase_properties 'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ', 'αβγδεζηθικλμνξοπρστυφχψω'
|
||||||
end
|
end
|
||||||
|
|
||||||
def no_longer_a_test_buffer_allocations
|
def no_longer_a_test_buffer_allocations
|
||||||
assert_equal 'TURKISH*ı'*10, ('I'*10).downcase(:turkic, :lithuanian)
|
assert_equal 'TURKISH*ı'*10, ('I'*10).downcase(:turkic)
|
||||||
assert_equal 'TURKISH*ı'*100, ('I'*100).downcase(:turkic, :lithuanian)
|
assert_equal 'TURKISH*ı'*100, ('I'*100).downcase(:turkic)
|
||||||
assert_equal 'TURKISH*ı'*1_000, ('I'*1_000).downcase(:turkic, :lithuanian)
|
assert_equal 'TURKISH*ı'*1_000, ('I'*1_000).downcase(:turkic)
|
||||||
assert_equal 'TURKISH*ı'*10_000, ('I'*10_000).downcase(:turkic, :lithuanian)
|
assert_equal 'TURKISH*ı'*10_000, ('I'*10_000).downcase(:turkic)
|
||||||
assert_equal 'TURKISH*ı'*100_000, ('I'*100_000).downcase(:turkic, :lithuanian)
|
assert_equal 'TURKISH*ı'*100_000, ('I'*100_000).downcase(:turkic)
|
||||||
assert_equal 'TURKISH*ı'*1_000_000, ('I'*1_000_000).downcase(:turkic, :lithuanian)
|
assert_equal 'TURKISH*ı'*1_000_000, ('I'*1_000_000).downcase(:turkic)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue