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

ruby-changes:2048

From: ko1@a...
Date: 28 Sep 2007 09:23:51 +0900
Subject: [ruby-changes:2048] akr - Ruby:r13539 (trunk): thread variable test refined.

akr	2007-09-28 09:23:40 +0900 (Fri, 28 Sep 2007)

  New Revision: 13539

  Modified files:
    trunk/bootstraptest/test_knownbug.rb

  Log:
    thread variable test refined.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/bootstraptest/test_knownbug.rb?r1=13539&r2=13538

Index: bootstraptest/test_knownbug.rb
===================================================================
--- bootstraptest/test_knownbug.rb	(revision 13538)
+++ bootstraptest/test_knownbug.rb	(revision 13539)
@@ -13,7 +13,7 @@
   w.write "a"
 }, '[ruby-dev:31866]'
 
-assert_equal "[[nil, 1, 1, nil, nil], [nil, 2, 2, nil]]", %q{
+assert_equal "[[nil, 1, 3, 3, 1, nil, nil], [nil, 2, 2, nil]]", %q{
   def tvar(var, val)
     old = Thread.current[var]
     begin
@@ -26,24 +26,18 @@
   ary1 = []
   ary2 = []
   fb = Fiber.new {
+    ary2 << Thread.current[:v]; tvar(:v, 2) {
+    ary2 << Thread.current[:v];   Fiber.yield
+    ary2 << Thread.current[:v]; }
+    ary2 << Thread.current[:v]; Fiber.yield
     ary2 << Thread.current[:v]
-    tvar(:v, 2) {
-      ary2 << Thread.current[:v]
-      Fiber.yield
-      ary2 << Thread.current[:v]
-    }
-    ary2 << Thread.current[:v]
-    Fiber.yield
-    ary2 << Thread.current[:v]
   }
-  ary1 << Thread.current[:v]
-  tvar(:v,1) {
-    ary1 << Thread.current[:v]
-    fb.resume
-    ary1 << Thread.current[:v]
-  }
-  ary1 << Thread.current[:v]
-  fb.resume
-  ary1 << Thread.current[:v]
+  ary1 << Thread.current[:v]; tvar(:v,1) {
+  ary1 << Thread.current[:v];   tvar(:v,3) {
+  ary1 << Thread.current[:v];     fb.resume
+  ary1 << Thread.current[:v];   }
+  ary1 << Thread.current[:v]; }
+  ary1 << Thread.current[:v]; fb.resume
+  ary1 << Thread.current[:v];
   [ary1, ary2]
 }

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

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