diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-02 00:16:24 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-02 00:16:24 +0000 |
commit | 21729a1c7796cb152f9dc13b56ca2d761e511a96 (patch) | |
tree | e0ae786506f1338549db59f637afe7a0c2264278 /test | |
parent | 5a930580c9ec152ac3940b3b5ecfe2a86813835c (diff) |
* parse.y (regexp): fix /#{}\xa1\xa2/e to be EUC-JP.
(reg_fragment_setenc_gen): extracted from reg_compile_gen.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_m17n.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index bb0a8a5010..8f763e029a 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -301,4 +301,12 @@ class TestM17N < Test::Unit::TestCase } } end + + def test_dynamic_euc_regexp + assert_encoding("EUC-JP", /#{}\xc0\xa1/e.encoding) + assert_raise(RegexpError) { eval('/\xa1#{}/e') } + assert_raise(RegexpError) { eval('/#{}\xa1/e') } + #assert_raise(SyntaxError) { eval('/\xa1#{}\xa1/e') } + #assert_raise(SyntaxError) { s = e('\xa1'); /#{s}#{s}/ } + end end |