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

* 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
This commit is contained in:
duerst 2016-03-17 03:09:00 +00:00
parent 551f6b3a18
commit fdbb82967f
3 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,9 @@
Thu Mar 17 12:09:00 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
* 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 <nobu@ruby-lang.org> Thu Mar 17 11:36:27 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/socket/option.c (inspect_tcpi_msec): more accurate condition * ext/socket/option.c (inspect_tcpi_msec): more accurate condition

View file

@ -147,7 +147,7 @@ code3_equal(const OnigCodePoint *x, const OnigCodePoint *y)
#define SpecialsCodepointExtract(n) ((n)&((1<<SpecialsLengthOffset)-1)) #define SpecialsCodepointExtract(n) ((n)&((1<<SpecialsLengthOffset)-1))
#define SpecialsLengthEncode(n) ((n)<<SpecialsLengthOffset) #define SpecialsLengthEncode(n) ((n)<<SpecialsLengthOffset)
#define OnigSpecialIndexMask (((1<<OnigSpecialIndexWidth)-1)<<OnigSpecialIndexWidth) #define OnigSpecialIndexMask (((1<<OnigSpecialIndexWidth)-1)<<OnigSpecialIndexShift)
#define OnigSpecialIndexEncode(n) ((n)<<OnigSpecialIndexShift) #define OnigSpecialIndexEncode(n) ((n)<<OnigSpecialIndexShift)
#define OnigSpecialIndexDecode(n) (((n)&OnigSpecialIndexMask)>>OnigSpecialIndexShift) #define OnigSpecialIndexDecode(n) (((n)&OnigSpecialIndexMask)>>OnigSpecialIndexShift)
@ -158,7 +158,7 @@ code3_equal(const OnigCodePoint *x, const OnigCodePoint *y)
#define ST ONIGENC_CASE_TITLECASE #define ST ONIGENC_CASE_TITLECASE
#define SU ONIGENC_CASE_UP_SPECIAL #define SU ONIGENC_CASE_UP_SPECIAL
#define SL ONIGENC_CASE_DOWN_SPECIAL #define SL ONIGENC_CASE_DOWN_SPECIAL
#define I(n) 0 #define I(n) OnigSpecialIndexEncode(n)
#define L(n) SpecialsLengthEncode(n) #define L(n) SpecialsLengthEncode(n)
#include "enc/unicode/casefold.h" #include "enc/unicode/casefold.h"

View file

@ -64,6 +64,12 @@ class TestCaseMappingPreliminary < Test::Unit::TestCase
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ňőńÆŁĨŻÀŤÏŌŅ', :lithuanian
end 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 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", 'ᎠᎡᎢᎣᎤᎥᎦᎧᎨᎩ', :lithuanian
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", :lithuanian