Skip to content

Add struct equality expectations #120

@jackfirth

Description

@jackfirth

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions