Closed
Description
Description
The following fails:
Seq.init 100 ((+) 1)
|> should equal (Seq.init 100 ((+) 1))
Repro steps
See above.
Expected behavior
Should succeed.
Actual behavior
Gives test error:
FsUnit.Xunit+MatchException : Exception of type 'FsUnit.Xunit+MatchException' was thrown.
Expected: Equals seq [1; 2; 3; 4; ...]
Actual: seq [1; 2; 3; 4; ...]
Which is rather confusing as it doesn't show where the two sequences diverge (spoiler alert: they don't ;) ).
Known workarounds
A workaround is to not use sequences in tests
I.e.: turning them into eager collections works fine:
Seq.init 100 ((+) 1)
|> Array.ofSeq
|> should equal (Seq.init 100 ((+) 1) |> Array.ofSeq)
Related information
Version 5.0.5
Using: FsUnit.Xunit
Metadata
Metadata
Assignees
Labels
No labels