aboutsummaryrefslogtreecommitdiffstats
path: root/test
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
commit1a32af4e7a1527ebe6b4b1205c522fa9ebd56344 (patch)
treeeb27624ef0bd7b0bfae29535b29f577b7ebef8dd /test
parent3d0bd1c6269a7945dc1da22e212d47600942715d (diff)
downloadruby-1a32af4e7a1527ebe6b4b1205c522fa9ebd56344.tar.gz
* 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
Diffstat (limited to 'test')
-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 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