From fdbb82967f54491b3b209af8f2d4aeedfb5ea214 Mon Sep 17 00:00:00 2001 From: duerst Date: Thu, 17 Mar 2016 03:09:00 +0000 Subject: [PATCH] * enc/unicode.c: Fixed two macro definitions. * test/ruby/enc/test_case_mapping.rb: Test cases that detected the above bugs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ enc/unicode.c | 4 ++-- test/ruby/enc/test_case_mapping.rb | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b3159c2dc4..96fc0a96b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Mar 17 12:09:00 2016 Martin Duerst + + * enc/unicode.c: Fixed two macro definitions. + * test/ruby/enc/test_case_mapping.rb: Test cases that detected + the above bugs. + Thu Mar 17 11:36:27 2016 Nobuyoshi Nakada * ext/socket/option.c (inspect_tcpi_msec): more accurate condition diff --git a/enc/unicode.c b/enc/unicode.c index 5087c55a07..796eb94c19 100644 --- a/enc/unicode.c +++ b/enc/unicode.c @@ -147,7 +147,7 @@ code3_equal(const OnigCodePoint *x, const OnigCodePoint *y) #define SpecialsCodepointExtract(n) ((n)&((1<>OnigSpecialIndexShift) @@ -158,7 +158,7 @@ code3_equal(const OnigCodePoint *x, const OnigCodePoint *y) #define ST ONIGENC_CASE_TITLECASE #define SU ONIGENC_CASE_UP_SPECIAL #define SL ONIGENC_CASE_DOWN_SPECIAL -#define I(n) 0 +#define I(n) OnigSpecialIndexEncode(n) #define L(n) SpecialsLengthEncode(n) #include "enc/unicode/casefold.h" diff --git a/test/ruby/enc/test_case_mapping.rb b/test/ruby/enc/test_case_mapping.rb index cd0565acb6..56d43b97c1 100644 --- a/test/ruby/enc/test_case_mapping.rb +++ b/test/ruby/enc/test_case_mapping.rb @@ -64,6 +64,12 @@ class TestCaseMappingPreliminary < Test::Unit::TestCase check_swapcase_properties 'résumé DÜRST ĭñŧėřŊÃŢIJŇŐŃæłĩżàťïōņ', 'RÉSUMÉ dürst ĬÑŦĖŘŋãţijňőńÆŁĨŻÀŤÏŌŅ', :lithuanian end + def test_various + check_upcase_properties 'Μ', 'µ', :lithuanian # MICRO SIGN -> Greek Mu + check_capitalize_properties 'Ss', 'ß', :lithuanian + check_upcase_properties 'SS', 'ß', :lithuanian + end + def test_cherokee check_downcase_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", :lithuanian