summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-12 18:45:44 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-12 18:45:44 +0000
commit0b2d3848b03f3affba4f4b021adea88e0b16e471 (patch)
tree66b1d95475642a877bceb08a853486cdeab5ed77 /test
parentb542e00a2a9b51cab5597dd814dd713c4aac6803 (diff)
downloadruby-0b2d3848b03f3affba4f4b021adea88e0b16e471.tar.gz
ruby-0b2d3848b03f3affba4f4b021adea88e0b16e471.tar.xz
ruby-0b2d3848b03f3affba4f4b021adea88e0b16e471.zip
* transcode.c (rb_econv_prepare_opts): raise ArgumentError if
a broken string is specified as a replacement. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_econv.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb
index 4ea2475da..a26647627 100644
--- a/test/ruby/test_econv.rb
+++ b/test/ruby/test_econv.rb
@@ -871,4 +871,11 @@ class TestEncodingConverter < Test::Unit::TestCase
assert_equal([[iso88591,utf8], "universal_newline", [utf8,utf32be]],
Encoding::Converter.search_convpath("ISO-8859-1", "UTF-32BE", universal_newline: true))
end
+
+ def test_invalid_replace
+ assert_raise(ArgumentError) {
+ broken = "\x80".force_encoding("euc-jp")
+ "".encode("euc-jp", :undef => :replace, :replace => broken)
+ }
+ end
end