You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In tests, we may want to use an Equatable to verify two structs are equal (or two arrays of equatable structs):
struct Mock {
struct Args: Equatable {
let param1: String
}
var invocations: [Args] = []
func callFunction(param1: String) {
invocations.append(Args(param1: param1))
}
}
// Then in tests
#expect(mock.invocations == expectedInvocations)
Periphery will identify param1 as assigned but never used if it's only used for this purpose. Would be nice to have a --retain-equatable-properties flag similar to --retain-codable-properties
The text was updated successfully, but these errors were encountered:
In tests, we may want to use an Equatable to verify two structs are equal (or two arrays of equatable structs):
Periphery will identify
param1
as assigned but never used if it's only used for this purpose. Would be nice to have a--retain-equatable-properties
flag similar to --retain-codable-propertiesThe text was updated successfully, but these errors were encountered: