From 2d83da799abddd7be3139b5c40ef8ba496d814aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 28 Aug 2025 13:10:35 +0200 Subject: [PATCH] Resubscribe before waiting for `Task` in `Emulator` --- test/src/emulator.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/src/emulator.rs b/test/src/emulator.rs index 3d0b1263..1c663bf8 100644 --- a/test/src/emulator.rs +++ b/test/src/emulator.rs @@ -101,8 +101,8 @@ impl Emulator

{ pending_tasks: 0, }; - emulator.wait_for(task); emulator.resubscribe(program); + emulator.wait_for(task); emulator } @@ -110,6 +110,8 @@ impl Emulator

{ pub fn update(&mut self, program: &P, message: P::Message) { let task = program.update(&mut self.state, message); + self.resubscribe(program); + match self.mode { Mode::Zen if self.pending_tasks > 0 => self.wait_for(task), _ => { @@ -120,8 +122,6 @@ impl Emulator

{ } } } - - self.resubscribe(program); } pub fn perform(&mut self, program: &P, action: Action

) { @@ -290,8 +290,8 @@ impl Emulator

{ program.update(&mut self.state, message) })); - self.wait_for(task); self.resubscribe(program); + self.wait_for(task); } Instruction::Expect(expectation) => match expectation { instruction::Expectation::Text(text) => {