@@ -84,18 +84,42 @@ class BlockingMoleculesSpec extends FlatSpec with Matchers with TimeLimitedTests
8484
8585 behavior of " syntax of blocking molecules with unit values / replies"
8686
87+ it should " allow non-unit values and non-unit replies" in {
88+ val f = new B [Int ,Int ](" f" )
89+ site(tp0)( _go { case f(x, r) if x == 123 => r(456 ) })
90+ f(123 ) shouldEqual 456
91+ }
92+
93+ it should " allow non-unit values and non-unit replies with timeout" in {
94+ val f = new B [Int ,Int ](" f" )
95+ site(tp0)( _go { case f(x, r) if x != 123 => r(456 ) })
96+ f.timeout(200 millis)(123 ) shouldEqual None
97+ }
98+
8799 it should " allow non-unit values and unit replies" in {
88100 val f = new BE [Int ](" f" )
89101 site(tp0)( _go { case f(x, r) if x == 123 => r() })
90102 f(123 ) shouldEqual (())
91103 }
92104
105+ it should " allow non-unit values and unit replies with timeout" in {
106+ val f = new BE [Int ](" f" )
107+ site(tp0)( _go { case f(x, r) if x != 123 => r() })
108+ f.timeout(200 millis)(123 ) shouldEqual None
109+ }
110+
93111 it should " allow unit values and unit replies" in {
94112 val f = new EE (" f" )
95113 site(tp0)( _go { case f(x, r) if x == (()) => r() })
96114 f() shouldEqual (())
97115 }
98116
117+ it should " allow unit values and unit replies with timeout" in {
118+ val f = new EE (" f" )
119+ site(tp0)( _go { case f(x, r) if x != (()) => r() })
120+ f.timeout(200 millis)() shouldEqual None
121+ }
122+
99123 behavior of " reaction sites with invalid replies"
100124
101125 it should " use the first reply when a reaction attempts to reply twice" in {
0 commit comments