From 1a32af4e7a1527ebe6b4b1205c522fa9ebd56344 Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 4 Jul 2008 23:50:33 +0000 Subject: * 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@17884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_m17n.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index c5871898fe..b2a67686aa 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 -- cgit v1.2.3