summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_m17n.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-04 23:50:33 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-04 23:50:33 +0000
commit4987551145411af7369f9d7174cba245d1d5a696 (patch)
treeeb27624ef0bd7b0bfae29535b29f577b7ebef8dd /test/ruby/test_m17n.rb
parent7c6edc334522e2167770da36d01f09c4a94606e7 (diff)
downloadruby-4987551145411af7369f9d7174cba245d1d5a696.tar.gz
ruby-4987551145411af7369f9d7174cba245d1d5a696.tar.xz
ruby-4987551145411af7369f9d7174cba245d1d5a696.zip
* re.c (unescape_nonascii): add has_property argument not to
raise error by /\p{Hiragana}\u{3042}/ in EUC-JP script. (rb_reg_preprocess): use has_property argument to make regexp encoding fixed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_m17n.rb')
-rw-r--r--test/ruby/test_m17n.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index c5871898f..b2a67686a 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -510,6 +510,14 @@ class TestM17N < Test::Unit::TestCase
r = /\p{Hiragana}/e
assert(r.fixed_encoding?)
assert_match(r, "\xa4\xa2".force_encoding("euc-jp"))
+
+ r = eval('/\u{3042}\p{Hiragana}/'.force_encoding("euc-jp"))
+ assert(r.fixed_encoding?)
+ assert_equal(Encoding::UTF_8, r.encoding)
+
+ r = eval('/\p{Hiragana}\u{3042}/'.force_encoding("euc-jp"))
+ assert(r.fixed_encoding?)
+ assert_equal(Encoding::UTF_8, r.encoding)
end
def test_regexp_embed_preprocess