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

ruby-changes:6375

From: akr <ko1@a...>
Date: Sat, 5 Jul 2008 21:34:55 +0900 (JST)
Subject: [ruby-changes:6375] Ruby:r17891 (trunk): test_str_slice! refactored.

akr	2008-07-05 21:33:55 +0900 (Sat, 05 Jul 2008)

  New Revision: 17891

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

  Log:
    test_str_slice! refactored.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=17891

Index: test/ruby/test_m17n_comb.rb
===================================================================
--- test/ruby/test_m17n_comb.rb	(revision 17890)
+++ test/ruby/test_m17n_comb.rb	(revision 17891)
@@ -1122,6 +1122,8 @@
 
   def test_str_slice!
     each_slice_call {|s, *args|
+      desc_slice = "#{encdump s}.slice#{encdumpargs args}"
+      desc_slice_bang = "#{encdump s}.slice!#{encdumpargs args}"
       t = s.dup
       begin
         r = t.slice!(*args)
@@ -1129,14 +1131,14 @@
         e = $!
       end
       if e
-        assert_raise(e.class, "#{encdump s}.slice#{encdumpargs args}") { s.slice(*args) }
+        assert_raise(e.class, desc_slice) { s.slice(*args) }
         next
       end
       if !r
-        assert_nil(s.slice(*args))
+        assert_nil(s.slice(*args), desc_slice)
         next
       end
-      assert_equal(s.slice(*args), r)
+      assert_equal(s.slice(*args), r, desc_slice_bang)
       assert_equal(s.bytesize, r.bytesize + t.bytesize)
       if args.length == 1 && String === args[0]
         assert_equal(args[0].encoding, r.encoding,

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

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