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

Add struct equality expectations #120

Open
jackfirth opened this issue Sep 17, 2017 · 0 comments
Open

Add struct equality expectations #120

jackfirth opened this issue Sep 17, 2017 · 0 comments

Comments

@jackfirth
Copy link
Owner

Structs don't convert to expectations automatically for two reasons:

  • Unlike collections which may contain anything, structs often restrict the type of fields so expect-struct is required to make expectations that expect a field of a struct matches some expectation.
  • Only struct field positions are available at runtime, not accessor names. This makes it hard to produce good error messages when drilling down into struct fields.

The expect-struct combinator serves well enough for the first problem, but an expect-struct-equal? macro that combined a struct value with the accessors in a struct identifier could fix that.

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

No branches or pull requests

1 participant