diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-04 03:48:25 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-04 03:48:25 +0000 |
commit | 34072faa0d236b4ca5f423c82cc01c79f8276294 (patch) | |
tree | 965597bdf2a08e4cbbcff6df8629c8f08659c6ee /test | |
parent | 3cce74dc4c4abfb6840de4ba9bcea4df2f502b15 (diff) |
merges r26052 from trunk into ruby_1_9_1.
--
* string.c (rb_str_justify): fixed the case a fill size is a
multiple of the length of the padding. [ruby-dev:39856]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@26568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_string.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 7e9176e507..a14385e4fc 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -320,9 +320,12 @@ class TestString < Test::Unit::TestCase end + Bug2463 = '[ruby-dev:39856]' def test_center assert_equal(S("hello"), S("hello").center(4)) assert_equal(S(" hello "), S("hello").center(11)) + assert_equal(S("ababaababa"), S("").center(10, "ab"), Bug2463) + assert_equal(S("ababaababab"), S("").center(11, "ab"), Bug2463) end def test_chomp @@ -779,6 +782,8 @@ class TestString < Test::Unit::TestCase def test_ljust assert_equal(S("hello"), S("hello").ljust(4)) assert_equal(S("hello "), S("hello").ljust(11)) + assert_equal(S("ababababab"), S("").ljust(10, "ab"), Bug2463) + assert_equal(S("abababababa"), S("").ljust(11, "ab"), Bug2463) end def test_next @@ -917,6 +922,8 @@ class TestString < Test::Unit::TestCase def test_rjust assert_equal(S("hello"), S("hello").rjust(4)) assert_equal(S(" hello"), S("hello").rjust(11)) + assert_equal(S("ababababab"), S("").rjust(10, "ab"), Bug2463) + assert_equal(S("abababababa"), S("").rjust(11, "ab"), Bug2463) end def test_scan |