From 32117f37637eca30dc4ad37968c50a3c9be01e73 Mon Sep 17 00:00:00 2001 From: Petros Papapanagiotou Date: Fri, 23 Aug 2024 13:21:16 +0100 Subject: [PATCH] test: Fix tests from #9 with syntax from #11 (#12) --- .../scala/com/suprnation/fsm/ContextFSMSuite.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/scala/com/suprnation/fsm/ContextFSMSuite.scala b/src/test/scala/com/suprnation/fsm/ContextFSMSuite.scala index a5c0ceb..c0da091 100644 --- a/src/test/scala/com/suprnation/fsm/ContextFSMSuite.scala +++ b/src/test/scala/com/suprnation/fsm/ContextFSMSuite.scala @@ -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