Skip to content
This repository was archived by the owner on Apr 23, 2026. It is now read-only.
This repository was archived by the owner on Apr 23, 2026. It is now read-only.

Compare any instances #46

@eliasson

Description

@eliasson

Support to match any instances are required.

The following test fails, since there is not equality check for type Data:

"for case classes":
      "can compare" in:
        class Data(value: Int)
        expect(Data(1)).toEqual(Data(1))
[error] /Users/markus/Development/factor10/dotty-intent/src/test/scala/intent/matchers/ToEqualTest.scala:117:41: no implicit argument of type intent.core.Eq[Data] was found for parameter eqq of method toEqual in trait ExpectGivens.
[error] I found:
[error]
[error]     this.tryEq[TInner, T]
[error]
[error] But method tryEq in trait EqGivens does not match type intent.core.Eq[Data].
[error]         expect(Data(1)).toEqual(Data(1))
[error]                                         ^
[error] one error found
[error] (Test / compileIncremental) Compilation failed
[error] Total time: 5 s, completed 19 feb. 2020 23:24:51

Preferably any types should be comparable with toEqual at least. Result should be a pretty-printed type and structural difference between expected and actual.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions