=str #16231: Protect jumpback table from corruption

This commit is contained in:
Endre Sándor Varga 2015-01-26 10:31:57 +01:00
parent 82195d63a3
commit 5202d59dda
3 changed files with 63 additions and 1 deletions

View file

@ -3,6 +3,8 @@
*/
package akka.stream.impl.fusing
import akka.stream.impl.fusing.Map
import scala.util.control.NoStackTrace
class InterpreterSpec extends InterpreterSpecKit {
@ -419,6 +421,38 @@ class InterpreterSpec extends InterpreterSpecKit {
}
"work with jumpback table and completed elements" in new TestSetup(Seq(
Map((x: Int) x),
Map((x: Int) x),
KeepGoing(),
Map((x: Int) x),
Map((x: Int) x))) {
lastEvents() should be(Set.empty)
downstream.requestOne()
lastEvents() should be(Set(RequestOne))
upstream.onNext(1)
lastEvents() should be(Set(OnNext(1)))
downstream.requestOne()
lastEvents() should be(Set(RequestOne))
upstream.onNext(2)
lastEvents() should be(Set(OnNext(2)))
upstream.onComplete()
lastEvents() should be(Set.empty)
downstream.requestOne()
lastEvents() should be(Set(OnNext(2)))
downstream.requestOne()
lastEvents() should be(Set(OnNext(2)))
}
"implement expand-filter" in pending
"implement take-conflate" in pending