summaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-02 00:16:24 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-02 00:16:24 +0000
commit2ce60f478a0f0462307c5d7698bc46db396d9398 (patch)
treee0ae786506f1338549db59f637afe7a0c2264278 /test/ruby
parent716da534c936149b3beb383c6915d33164fc44cf (diff)
downloadruby-2ce60f478a0f0462307c5d7698bc46db396d9398.tar.gz
ruby-2ce60f478a0f0462307c5d7698bc46db396d9398.tar.xz
ruby-2ce60f478a0f0462307c5d7698bc46db396d9398.zip
* parse.y (regexp): fix /#{}\xa1\xa2/e to be EUC-JP.
(reg_fragment_setenc_gen): extracted from reg_compile_gen. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-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 bb0a8a501..8f763e029 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