mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
1 changed files with 7 additions and 5 deletions
|
@ -670,14 +670,15 @@ class TestM17N < Test::Unit::TestCase
|
|||
|
||||
def test_str_eq
|
||||
combination(STRINGS, STRINGS) {|s1, s2|
|
||||
desc_eq = "#{encdump s1} == #{encdump 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)
|
||||
assert(s1 == s2)
|
||||
assert(s1 == s2, desc_eq)
|
||||
assert(!(s1 != s2))
|
||||
assert_equal(0, s1 <=> s2)
|
||||
else
|
||||
assert(!(s1 == s2))
|
||||
assert(!(s1 == s2), "!(#{desc_eq})")
|
||||
assert(s1 != s2)
|
||||
assert_not_equal(0, s1 <=> s2)
|
||||
end
|
||||
|
@ -988,11 +989,12 @@ class TestM17N < Test::Unit::TestCase
|
|||
|
||||
def test_str_cmp
|
||||
combination(STRINGS, STRINGS) {|s1, s2|
|
||||
desc = "#{encdump s1} <=> #{encdump s2}"
|
||||
r = s1 <=> s2
|
||||
if s1 == s2
|
||||
assert_equal(0, r)
|
||||
assert_equal(0, r, desc)
|
||||
else
|
||||
assert_not_equal(0, r)
|
||||
assert_not_equal(0, r, desc)
|
||||
end
|
||||
}
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue