From c3b9d1f1ae06271a4b39399f5d914513f243133d Mon Sep 17 00:00:00 2001 From: Subeom Choi Date: Thu, 18 Jan 2024 15:14:00 +0900 Subject: [PATCH] fix: solve issue that wait mock function modify callback permanently --- Source/TestWait/TestMock/WaitMockFunction.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/TestWait/TestMock/WaitMockFunction.swift b/Source/TestWait/TestMock/WaitMockFunction.swift index ad03a6d..9bbc5d8 100644 --- a/Source/TestWait/TestMock/WaitMockFunction.swift +++ b/Source/TestWait/TestMock/WaitMockFunction.swift @@ -29,9 +29,10 @@ public struct WaitMockFunction { if until(argument, result) { callArgument = argument callResult = result - callback(argument, result) semaphore.signal() + mock.callback = callback } + callback(argument, result) } try block()