diff options
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r-- | test/ruby/test_string.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index b684ca8bd1..711d9ea1f9 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -174,7 +174,7 @@ class TestString < Test::Unit::TestCase s = "a" 10.times {|i| s << s - assert_equal("a" * (2<<i), s) + assert_equal("a" * (2 << i), s) } end @@ -1370,4 +1370,13 @@ class TestString < Test::Unit::TestCase def test_end_with? assert("abc".end_with?("c")) end + + def test_times + s1 = '' + 100.times {|n| + s2 = "a" * n + assert_equal(s1, s2) + s1 << 'a' + } + end end |