Skip to content

Commit

Permalink
add a test for RunnableWithInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei Winitzki committed Dec 27, 2016
1 parent dd8f0a0 commit 204178c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/src/test/scala/code/chymyst/jc/PoolSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ class PoolSpec extends FlatSpec with Matchers with TimeLimitedTests {
case t : ThreadWithInfo => Some(t.reactionInfo)
case _ => None
}
waiter { threadInfoOptOpt shouldEqual Some(Some(emptyReactionInfo)); () }
waiter {
threadInfoOptOpt shouldEqual Some(Some(emptyReactionInfo))
()
}
waiter.dismiss()

}, emptyReactionInfo)
Expand Down Expand Up @@ -129,6 +132,9 @@ class PoolSpec extends FlatSpec with Matchers with TimeLimitedTests {
val runnable = new RunnableWithInfo({
x = 1; waiter.dismiss()
}, emptyReactionInfo)

runnable.toString shouldEqual emptyReactionInfo.toString

val smartThread = new ThreadWithInfo(runnable)
smartThread.reactionInfo shouldEqual None // too early now, the runnable has not yet started
smartThread.start()
Expand Down

0 comments on commit 204178c

Please sign in to comment.