From 9da8a2976094dcc69ee6646727de14721d9845ef Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 22 Dec 2015 06:21:14 +0000 Subject: string.c: no exception on dummy encoding * string.c (str_compat_and_valid): as scrub does nothing for dummy encoding string now, incompatible encoding is not a matter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_m17n.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby/test_m17n.rb') diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index 9f96652083..3a45f1f028 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -1642,6 +1642,12 @@ class TestM17N < Test::Unit::TestCase scrub) end + def test_scrub_dummy_encoding + s = "\u{3042}".encode("iso-2022-jp") + assert_equal(s, s.scrub) + assert_equal(s, s.force_encoding("iso-2022-jp").scrub("?")) + end + def test_scrub_bang str = "\u3042\u3044" assert_same(str, str.scrub!) -- cgit v1.2.3