mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
merges r30727 and r30731 from trunk into ruby_1_9_2.
-- * enc/emacs_mule.c (emacsmule_islead): fix inverse condition. -- * enc/emacs_mule.c (emacsmule_islead): 7bit range is also leading byte. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b243ccc46e
commit
ed08646487
4 changed files with 29 additions and 2 deletions
|
@ -1,3 +1,12 @@
|
|||
Sun Jan 30 15:13:19 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* enc/emacs_mule.c (emacsmule_islead): 7bit range is also leading
|
||||
byte.
|
||||
|
||||
Sun Jan 30 12:53:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* enc/emacs_mule.c (emacsmule_islead): fix inverse condition.
|
||||
|
||||
Sun Jan 30 08:02:55 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* configure.in: Mac OS X wrongly reports it has fdatasync(3).
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "regint.h"
|
||||
|
||||
|
||||
#define emacsmule_islead(c) ((UChar )((c) - 0x81) > 0x9d - 0x81)
|
||||
#define emacsmule_islead(c) ((UChar )(c) < 0x9e)
|
||||
|
||||
/*
|
||||
CHARACTER := ASCII_CHAR | MULTIBYTE_CHAR
|
||||
|
|
|
@ -1074,6 +1074,12 @@ class TestM17N < Test::Unit::TestCase
|
|||
s1 = s("\x81\x40")
|
||||
s2 = "@"
|
||||
assert_equal(false, s1.end_with?(s2), "#{encdump s1}.end_with?(#{encdump s2})")
|
||||
each_encoding("\u3042\u3044", "\u3044") do |_s1, _s2|
|
||||
assert_equal(true, _s1.end_with?(_s2), "#{encdump _s1}.end_with?(#{encdump _s2})")
|
||||
end
|
||||
each_encoding("\u3042a\u3044", "a\u3044") do |_s1, _s2|
|
||||
assert_equal(true, _s1.end_with?(_s2), "#{encdump _s1}.end_with?(#{encdump _s2})")
|
||||
end
|
||||
end
|
||||
|
||||
def test_each_line
|
||||
|
@ -1108,6 +1114,10 @@ class TestM17N < Test::Unit::TestCase
|
|||
assert_equal(e("\xa1\xa2\xa1\xa3").split(//),
|
||||
[e("\xa1\xa2"), e("\xa1\xa3")],
|
||||
'[ruby-dev:32452]')
|
||||
|
||||
each_encoding("abc,def", ",", "abc", "def") do |str, sep, *expected|
|
||||
assert_equal(expected, str.split(sep, -1))
|
||||
end
|
||||
end
|
||||
|
||||
def test_nonascii_method_name
|
||||
|
@ -1353,4 +1363,12 @@ class TestM17N < Test::Unit::TestCase
|
|||
def test_combchar_codepoint
|
||||
assert_equal([0x30BB, 0x309A], "\u30BB\u309A".codepoints.to_a)
|
||||
end
|
||||
|
||||
def each_encoding(*strings)
|
||||
Encoding.list.each do |enc|
|
||||
next if enc.dummy?
|
||||
strs = strings.map {|s| s.encode(enc)} rescue next
|
||||
yield *strs
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#define RUBY_VERSION "1.9.2"
|
||||
#define RUBY_PATCHLEVEL 181
|
||||
#define RUBY_PATCHLEVEL 182
|
||||
#define RUBY_VERSION_MAJOR 1
|
||||
#define RUBY_VERSION_MINOR 9
|
||||
#define RUBY_VERSION_TEENY 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue