Skip to content
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

--retain-equatable-properties option #869

Open
pm-dev opened this issue Jan 17, 2025 · 0 comments
Open

--retain-equatable-properties option #869

pm-dev opened this issue Jan 17, 2025 · 0 comments

Comments

@pm-dev
Copy link

pm-dev commented Jan 17, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant