pekko/akka-docs/src/test/scala/docs/stream/MigrationsScala.scala
Patrik Nordwall 5c96a5f556 replace unicode arrows
* ⇒, →, ←
* because we don't want to show them in documentation snippets and
  then it's complicated to avoid that when snippets are
  located in src/test/scala in individual modules
* dont replace object `→` in FSM.scala and PersistentFSM.scala
2019-03-11 16:58:51 +01:00

36 lines
745 B
Scala

/*
* Copyright (C) 2015-2019 Lightbend Inc. <https://www.lightbend.com>
*/
package docs.stream
import akka.stream.scaladsl._
import akka.testkit.AkkaSpec
class MigrationsScala extends AkkaSpec {
"Examples in migration guide" must {
"compile" in {
lazy val dontExecuteMe = {
//#expand-continually
Flow[Int].expand(Iterator.continually(_))
//#expand-continually
//#expand-state
Flow[Int].expand(i => {
var state = 0
Iterator.continually({
state += 1
(i, state)
})
})
//#expand-state
//#async
val flow = Flow[Int].map(_ + 1)
Source(1 to 10).via(flow.async)
//#async
}
}
}
}