summaryrefslogtreecommitdiff
path: root/test/-ext-/string
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-12 01:20:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-12 01:20:41 +0000
commit88ae402cbf008f96db10d1acb39b6078fb1f8de2 (patch)
tree83a07c9f17adc183adfa3964f5b7ea8bc1bb2a42 /test/-ext-/string
parent1d60b6eff96ad138702915e2596969df4e9e4f56 (diff)
string.c: term fill
* string.c (tr_trans): fill wchar terminator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-/string')
-rw-r--r--test/-ext-/string/test_cstr.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/-ext-/string/test_cstr.rb b/test/-ext-/string/test_cstr.rb
index 9c2b73f..6f2fdef 100644
--- a/test/-ext-/string/test_cstr.rb
+++ b/test/-ext-/string/test_cstr.rb
@@ -72,6 +72,20 @@ class Test_StringCStr < Test::Unit::TestCase
assert_wchars_term_char("foo!") {|s| s.squeeze!}
end
+ def test_wchar_tr!
+ assert_wchars_term_char("\u{3042}foobar") {|s|
+ enc = s.encoding
+ s.tr!("\u{3042}".encode(enc), "c".encode(enc))
+ }
+ end
+
+ def test_wchar_tr_s!
+ assert_wchars_term_char("\u{3042}foobar") {|s|
+ enc = s.encoding
+ s.tr_s!("\u{3042}".encode(enc), "c".encode(enc))
+ }
+ end
+
def assert_wchars_term_char(str)
result = {}
WCHARS.map do |enc|