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

ruby-changes:23849

From: ko1 <ko1@a...>
Date: Mon, 4 Jun 2012 12:04:46 +0900 (JST)
Subject: [ruby-changes:23849] ko1:r35900 (trunk): * test/ruby/test_backtrace.rb: fix test.

ko1	2012-06-04 12:04:34 +0900 (Mon, 04 Jun 2012)

  New Revision: 35900

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

  Log:
    * test/ruby/test_backtrace.rb: fix test.
      Windows path includes `:' character.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_backtrace.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 35899)
+++ ChangeLog	(revision 35900)
@@ -1,3 +1,8 @@
+Mon Jun  4 12:01:21 2012  Koichi Sasada  <ko1@a...>
+
+	* test/ruby/test_backtrace.rb: fix test.
+	  Windows path includes `:' character.
+
 Mon Jun  4 11:42:39 2012  Koichi Sasada  <ko1@a...>
 
 	* vm_core.h (rb_location_t): fix type and field name.
Index: test/ruby/test_backtrace.rb
===================================================================
--- test/ruby/test_backtrace.rb	(revision 35899)
+++ test/ruby/test_backtrace.rb	(revision 35900)
@@ -86,20 +86,9 @@
   end
 
   def test_caller_locations
-    locs = caller_locations(0); cs = caller(0).map{|line|
-      path, lineno, label_str = line.split(':')
-      unless label_str
-        label_str = lineno
-        lineno = 0
-      end
-      lineno = lineno.to_i
-      if /in `(.+?)\'/ =~ label_str
-        label = $1
-      else
-        label = nil
-      end
-      [path, lineno, label]
+    cs = caller(0); locs = caller_locations(0).map{|loc|
+      loc.to_s
     }
-    assert_equal(locs.map{|loc| [loc.path, loc.lineno, loc.label]}, cs)
+    assert_equal(cs, locs)
   end
 end

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

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