Skip to content

Commit

Permalink
test: Fix tests from #9 with syntax from #11 (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrosPapapa authored Aug 23, 2024
1 parent 33d39c2 commit 32117f3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/test/scala/com/suprnation/fsm/ContextFSMSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ object ContextFSMSuite {
stopped: Deferred[IO, Boolean]
): IO[ReplyingActor[IO, FsmRequest, Any]] =
FSM[IO, FsmParentState, Int, FsmRequest, Any]
.when(FsmIdle) { case (Event(FsmRun, _), sM) =>
.when(FsmIdle)(sM => { case Event(FsmRun, _) =>
for {
fsmChildActor <- sM.minimalContext.actorOf(FsmChild())
result <- fsmChildActor ? FsmChildEcho
state <- sM.goto(FsmRunning).replying(result)
} yield state
}
.when(FsmRunning) {
case (Event(FsmRun, _), sM) =>
})
.when(FsmRunning)(sM => {
case Event(FsmRun, _) =>
(sM.minimalContext.self ! FsmStop) *> sM.stay()
case (Event(FsmStop, _), sM) =>
case Event(FsmStop, _) =>
stopped.complete(true) *> sM.stay()
}
})
.withConfig(FSMConfig.withConsoleInformation)
.startWith(startWith, 0)
.initialize
Expand Down

0 comments on commit 32117f3

Please sign in to comment.