[前][次][番号順一覧][スレッド一覧]

ruby-changes:3043

From: ko1@a...
Date: 24 Dec 2007 01:25:59 +0900
Subject: [ruby-changes:3043] akr - Ruby:r14535 (trunk): add assertion messages.

akr	2007-12-24 01:25:49 +0900 (Mon, 24 Dec 2007)

  New Revision: 14535

  Modified files:
    trunk/test/ruby/test_m17n.rb

  Log:
    add assertion messages.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_m17n.rb?r1=14535&r2=14534

Index: test/ruby/test_m17n.rb
===================================================================
--- test/ruby/test_m17n.rb	(revision 14534)
+++ test/ruby/test_m17n.rb	(revision 14535)
@@ -670,14 +670,15 @@
 
   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 @@
 
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]