Skip to content

Testing lists for equality gives unpleasant failure report #266

@snuup

Description

@snuup

[ 77 ] |> shouldEqual [ 99 ]

reports the failure

Unhandled exception. NUnit.Framework.AssertionException: Assert.That(, )
Expected: < 99 > or < 99 >
But was: < 77 >

This is caused by this tricky code in Equality.fs:

static member inline IsEqualTo(x: 'T) =
    match (box x) with
    | :? IStructuralEquatable -> Is.EqualTo(x).Or.EqualTo(x).Using<'T>(Equality.Structural)
    | :? IStructuralComparable -> Is.EqualTo(x).Or.EqualTo(x).Using<'T>(Equality.StructuralC)
    | _ -> Is.EqualTo(x)

(I did not succeed fixing this, removing the Or constraints leads to no detailed list comparison.)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions