-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concurrency safe handler #276
base: master
Are you sure you want to change the base?
Conversation
mockReturn = ".void" | ||
} else if let val = defaultVal { | ||
mockReturn = ".val(\(val))" | ||
struct Renderer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the implementation because the processing became more complex.
let fixtureContents = formattedDstContent.components(separatedBy: .whitespacesAndNewlines).filter{!$0.isEmpty} | ||
XCTAssert(fixtureContents == outputContents, "output:\n" + output) | ||
let fixtureContents = dstContent.components(separatedBy: .whitespacesAndNewlines).filter{!$0.isEmpty} | ||
XCTAssert(outputContents.contains(subArray: fixtureContents), "output:\n" + output) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of examining all lines, we check whether the output lines contain the fixture.
Issue: #249
When the mock protocol requires
Sendable
, correctly implement the mock functions asSendable
. To provide a concurrency-safe implementation, we also add some helper functions and types.This PR does not address stored properties or computed properties (Do it later).
As shown below, various function
Handler
s are required to beSendable
.