diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-02 14:20:06 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-02 14:20:06 +0000 |
commit | cddcffb8f9dd015650b2ac02235bfe39261989f9 (patch) | |
tree | d327758d47d6a93d6f9c20d07477be7b3b0a2c89 /test | |
parent | e1e8297a76cbe7918458cb37043ad498228c6139 (diff) | |
download | ruby-cddcffb8f9dd015650b2ac02235bfe39261989f9.tar.gz |
* string.c (str_byte_substr): return nil for negative length.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_string.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 0b632ab1a8..faa7bd670d 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -1961,6 +1961,7 @@ class TestString < Test::Unit::TestCase assert_equal("", "hello".byteslice(5, 1)) assert_equal("o", "hello".byteslice(-1, 6)) assert_equal(nil, "hello".byteslice(-6, 1)) + assert_equal(nil, "hello".byteslice(0, -1)) assert_equal("h", "hello".byteslice(0..0)) assert_equal("", "hello".byteslice(5..0)) |