summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-08 10:48:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-08 10:48:52 +0000
commit2045c3f7e2e15733d849348a698855594886dcb0 (patch)
treeabda3711646b98af1c41093bc4d14fdf55fd5ef5 /test
parent0f7ef7046c146b7ae5b8e1c5936260055f4fc4ce (diff)
downloadruby-2045c3f7e2e15733d849348a698855594886dcb0.tar.gz
ruby-2045c3f7e2e15733d849348a698855594886dcb0.tar.xz
ruby-2045c3f7e2e15733d849348a698855594886dcb0.zip
* test/ruby/test_string.rb (test_chop, test_chop!): tests for [ruby-core:23155].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_string.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index ee9c2144f..b209296ef 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -405,6 +405,7 @@ class TestString < Test::Unit::TestCase
assert_equal(S("hello\n"), S("hello\n\r").chop)
assert_equal(S(""), S("\r\n").chop)
assert_equal(S(""), S("").chop)
+ assert_equal(S("a").hash, S("a\u00d8").chop.hash)
end
def test_chop!
@@ -423,6 +424,10 @@ class TestString < Test::Unit::TestCase
a = S("").chop!
assert_nil(a)
+ a = S("a\u00d8")
+ a.chop!
+ assert_equal(S("a").hash, a.hash)
+
a = S("hello\n")
b = a.dup
assert_equal(S("hello"), a.chop!)