summaryrefslogtreecommitdiff
path: root/test/ruby/test_m17n.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-06 00:50:02 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-06 00:50:02 +0000
commita6ec2584527fb4d6f3a65a2dd16dc02eabdfcec6 (patch)
treedc7946982b288377e7decba6107feed262613bbc /test/ruby/test_m17n.rb
parent58ef0f06c6f6fcc4f6a0d31ade430d87ef9d968d (diff)
* string.c (rb_str_b): Add String#b, returning a copied string
whose encoding is ASCII-8BIT. [ruby-dev:45992] [Feature #6767] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_m17n.rb')
-rw-r--r--test/ruby/test_m17n.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 7e343ab31f..bdde127840 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -1471,4 +1471,14 @@ class TestM17N < Test::Unit::TestCase
yield(*strs)
end
end
+
+ def test_str_b
+ s = "\u3042"
+ assert_equal(a("\xE3\x81\x82"), s.b)
+ assert_equal(Encoding::ASCII_8BIT, s.b.encoding)
+ s.taint
+ assert_equal(true, s.b.tainted?)
+ s.untrust
+ assert_equal(true, s.b.untrusted?)
+ end
end