Comparing sequences fails
See original GitHub issueDescription
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
Issue Analytics
- State:
- Created a year ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Why does the comparison test fail here?
My conclusion is that the proposed inequality is actually false and so the direct comparison test cannot be applied, but the x must...
Read more >Comparative analyses of error handling strategies for next- ...
In the current study, we analyzed the effect of sequencing errors on diagnostic tests as well as the different error handling strategies. We ......
Read more >Interpreting alignment-free sequence comparison
The output from an alignment-free sequence comparison is a similarity score, the interpretation of which is not straightforward.
Read more >Finding errors in DNA sequences. - PMC
If the coding sequence shows similarity to a known protein sequence then such errors can be detected by comparing the conceptual translations of...
Read more >Sequencing error profiles of Illumina sequencing instruments
Comparing the error rates of sequencing platforms has been a focus of research since sequencing began. Every new platform has its advantages ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was counting on that, otherwise why add it, right?
You are not the only one who needs/needed this. 😉