add assertion messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8fb23913ad
commit
4b45ef7ba3
@ -670,14 +670,15 @@ class TestM17N < Test::Unit::TestCase
|
|||||||
|
|
||||||
def test_str_eq
|
def test_str_eq
|
||||||
combination(STRINGS, STRINGS) {|s1, s2|
|
combination(STRINGS, STRINGS) {|s1, s2|
|
||||||
|
desc_eq = "#{encdump s1} == #{encdump s2}"
|
||||||
if s1.ascii_only? && s2.ascii_only? && a(s1) == a(s2)
|
if s1.ascii_only? && s2.ascii_only? && a(s1) == a(s2)
|
||||||
assert(s1 == s2)
|
assert(s1 == s2, desc_eq)
|
||||||
elsif s1.encoding == s2.encoding && a(s1) == a(s2)
|
elsif s1.encoding == s2.encoding && a(s1) == a(s2)
|
||||||
assert(s1 == s2)
|
assert(s1 == s2, desc_eq)
|
||||||
assert(!(s1 != s2))
|
assert(!(s1 != s2))
|
||||||
assert_equal(0, s1 <=> s2)
|
assert_equal(0, s1 <=> s2)
|
||||||
else
|
else
|
||||||
assert(!(s1 == s2))
|
assert(!(s1 == s2), "!(#{desc_eq})")
|
||||||
assert(s1 != s2)
|
assert(s1 != s2)
|
||||||
assert_not_equal(0, s1 <=> s2)
|
assert_not_equal(0, s1 <=> s2)
|
||||||
end
|
end
|
||||||
@ -988,11 +989,12 @@ class TestM17N < Test::Unit::TestCase
|
|||||||
|
|
||||||
def test_str_cmp
|
def test_str_cmp
|
||||||
combination(STRINGS, STRINGS) {|s1, s2|
|
combination(STRINGS, STRINGS) {|s1, s2|
|
||||||
|
desc = "#{encdump s1} <=> #{encdump s2}"
|
||||||
r = s1 <=> s2
|
r = s1 <=> s2
|
||||||
if s1 == s2
|
if s1 == s2
|
||||||
assert_equal(0, r)
|
assert_equal(0, r, desc)
|
||||||
else
|
else
|
||||||
assert_not_equal(0, r)
|
assert_not_equal(0, r, desc)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user