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

ruby-changes:61259

From: Yusuke <ko1@a...>
Date: Fri, 15 May 2020 01:22:24 +0900 (JST)
Subject: [ruby-changes:61259] 7f86ad61cc (master): test/scheduler: suppress warnings

https://git.ruby-lang.org/ruby.git/commit/?id=7f86ad61cc

From 7f86ad61cceaffca0d47fe5dc706fbc2ca9ea166 Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Fri, 15 May 2020 01:21:12 +0900
Subject: test/scheduler: suppress warnings

https://rubyci.s3.amazonaws.com/debian/ruby-master/log/20200514T123004Z.log.html.gz

```
/home/chkbuild/chkbuild/tmp/build/20200514T123004Z/ruby/test/scheduler/scheduler.rb:29: warning: assigned but unused variable - fiber
/home/chkbuild/chkbuild/tmp/build/20200514T123004Z/ruby/test/scheduler/scheduler.rb:156: warning: method redefined; discarding old fiber
/home/chkbuild/chkbuild/tmp/build/20200514T123004Z/ruby/test/scheduler/test_fiber.rb:27: warning: ambiguous first argument; put parentheses or a space even after `/' operator
```

diff --git a/test/scheduler/scheduler.rb b/test/scheduler/scheduler.rb
index b2d36cc..820f441 100644
--- a/test/scheduler/scheduler.rb
+++ b/test/scheduler/scheduler.rb
@@ -18,15 +18,13 @@ class Scheduler https://github.com/ruby/ruby/blob/trunk/test/scheduler/scheduler.rb#L18
     @ios = ObjectSpace::WeakMap.new
   end
 
-  attr :fiber
-
   attr :readable
   attr :writable
   attr :waiting
   attr :blocking
 
   def next_timeout
-    fiber, timeout = @waiting.min_by{|key, value| value}
+    _fiber, timeout = @waiting.min_by{|key, value| value}
 
     if timeout
       offset = timeout - current_time
diff --git a/test/scheduler/test_fiber.rb b/test/scheduler/test_fiber.rb
index 3452591..3680650 100644
--- a/test/scheduler/test_fiber.rb
+++ b/test/scheduler/test_fiber.rb
@@ -24,6 +24,6 @@ class TestSchedulerFiber < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/scheduler/test_fiber.rb#L24
     thread.join
 
     assert_not_empty scheduler.blocking
-    assert_match /test_fiber.rb:\d+:in `close'/, scheduler.blocking.last
+    assert_match(/test_fiber\.rb:\d+:in `close'/, scheduler.blocking.last)
   end
 end
-- 
cgit v0.10.2


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

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