Project

General

Profile

Bug #5536 » 0002-test-ruby-test_string.rb-add-test_start_with-and-tes.patch

second set of patchs (tests) - Eregon (Benoit Daloze), 03/25/2012 09:11 PM

View differences:

test/ruby/test_string.rb
assert(!S("not").empty?)
end
def test_end_with?
assert S("hello").end_with?(S("llo"))
assert !S("hello").end_with?(S("ll"))
assert S("hello").end_with?(S("el"), S("lo"))
assert_raise(TypeError) { S("str").end_with? :not_convertible_to_string }
end
def test_eql?
a = S("hello")
assert(a.eql?(S("hello")))
......
assert_nil(a.squeeze!)
end
def test_start_with?
assert S("hello").start_with?(S("hel"))
assert !S("hello").start_with?(S("el"))
assert S("hello").start_with?(S("el"), S("he"))
assert_raise(TypeError) { S("str").start_with? :not_convertible_to_string }
end
def test_strip
assert_equal(S("x"), S(" x ").strip)
assert_equal(S("x"), S(" \n\r\t x \t\r\n\n ").strip)
......
assert_nil(l.slice!(/\A.*\n/), "[ruby-dev:31665]")
end
def test_end_with?
assert("abc".end_with?("c"))
end
def test_times2
s1 = ''
100.times {|n|
(4-4/4)