aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_io_m17n.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-28 05:55:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-28 05:55:22 +0000
commitffa153f282b8fb94734a3b33ba83cc8566a0231f (patch)
treeb509df29a5c4ccc6aa8e4440c96ec536af223139 /test/ruby/test_io_m17n.rb
parent7a4f70463d13fa2c508dcf3180b98f56559f592b (diff)
downloadruby-ffa153f282b8fb94734a3b33ba83cc8566a0231f.tar.gz
io.c: preserve encodings
* io.c (rb_io_extract_encoding_option): preserve encodings in warning messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_io_m17n.rb')
-rw-r--r--test/ruby/test_io_m17n.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
index e9e6a1cf83..7f54762ebe 100644
--- a/test/ruby/test_io_m17n.rb
+++ b/test/ruby/test_io_m17n.rb
@@ -312,6 +312,17 @@ EOT
}
end
+ def test_ignored_encoding_option
+ enc = "\u{30a8 30f3 30b3 30fc 30c7 30a3 30f3 30b0}"
+ pattern = /#{enc}/
+ assert_warning(pattern) {
+ open(IO::NULL, external_encoding: "us-ascii", encoding: enc)
+ }
+ assert_warning(pattern) {
+ open(IO::NULL, internal_encoding: "us-ascii", encoding: enc)
+ }
+ end
+
def test_io_new_enc
with_tmpdir {
generate_file("tmp", "\xa1")