From 4f78e7fff4949f5c94d35bce6b610d1188fd7c27 Mon Sep 17 00:00:00 2001 From: mame Date: Tue, 16 Mar 2010 16:26:04 +0000 Subject: * parse.y (rb_intern3): prohibit Symbol with an invalid encoding. [ruby-core:24621] * test/ruby/test_m17n_comb.rb: modify a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_m17n_comb.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/ruby/test_m17n_comb.rb b/test/ruby/test_m17n_comb.rb index ab891363b1..cf80377172 100644 --- a/test/ruby/test_m17n_comb.rb +++ b/test/ruby/test_m17n_comb.rb @@ -1040,10 +1040,12 @@ class TestM17NComb < Test::Unit::TestCase STRINGS.each {|s| if /\0/ =~ a(s) assert_raise(ArgumentError) { s.intern } - else + elsif s.valid_encoding? sym = s.intern assert_equal(s, sym.to_s, "#{encdump s}.intern.to_s") assert_equal(sym, s.to_sym) + else + assert_raise(EncodingError) { s.intern } end } end -- cgit v1.2.3