aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_m17n.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-11 01:03:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-11 01:03:37 +0000
commitc1a8666faf5a95e9bb9b1acb8f2fa3f1b9e46152 (patch)
tree3089e30811f9bf6cdcd548072002f7405a3f43e5 /test/ruby/test_m17n.rb
parentdbb3cc4d7fb56f7e6a6bc17a4548279bd4d7abf2 (diff)
downloadruby-c1a8666faf5a95e9bb9b1acb8f2fa3f1b9e46152.tar.gz
string.c: block for scrub with ASCII-incompatible
* string.c (rb_enc_str_scrub): honor the given block with ASCII-incompatible encoding. [ruby-core:79039] [Bug #13120] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_m17n.rb')
-rw-r--r--test/ruby/test_m17n.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 8b7e7e6b4a..c610f71216 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -1640,6 +1640,11 @@ class TestM17N < Test::Unit::TestCase
assert_equal("\uFFFD".encode("UTF-32LE"),
"\xff".force_encoding(Encoding::UTF_32LE).
scrub)
+ c = nil
+ assert_equal("?".encode(Encoding::UTF_16LE),
+ "\x00\xD8".force_encoding(Encoding::UTF_16LE).
+ scrub {|e| c = e; "?".encode(Encoding::UTF_16LE)})
+ assert_equal("\x00\xD8".force_encoding(Encoding::UTF_16LE), c)
end
def test_scrub_dummy_encoding