File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
src/test/scala/gopher/channels Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ class MacroSelectSuite extends FunSuite
335
335
assert(x2.isInstanceOf [ChannelClosedException ])
336
336
}
337
337
338
- test(" select with constant timeout" ) {
338
+ test(" select with constant timeout which not fire " ) {
339
339
// pending
340
340
import gopherApi ._
341
341
val ch1 = makeChannel[Int ](10 )
@@ -352,6 +352,21 @@ class MacroSelectSuite extends FunSuite
352
352
assert(x== 1 )
353
353
}
354
354
355
+ test(" select with constant timeout which fire" ) {
356
+ import gopherApi ._
357
+ val ch1 = makeChannel[Int ](10 )
358
+ val r = select.amap {
359
+ case x: ch1.read =>
360
+ // System.err.println(s"readed ${x}")
361
+ x
362
+ case x: select.timeout if (x== 500 .milliseconds) =>
363
+ // System.err.println(s"timeout ${x}")
364
+ - 1
365
+ }
366
+ val x = Await .result(r.aread, 10 seconds)
367
+ assert(x == - 1 )
368
+ }
369
+
355
370
lazy val gopherApi = CommonTestObjects .gopherApi
356
371
357
372
}
You can’t perform that action at this time.
0 commit comments