fsprojects / FSharpx.Collections

FSharpx.Collections is a collection of datastructures for use with F# and C#.
http://fsprojects.github.io/FSharpx.Collections/
Apache License 2.0
247 stars 78 forks source link

Fix ByteString.empty comparison problem #191

Closed gdziadkiewicz closed 1 year ago

gdziadkiewicz commented 2 years ago

While working on reenabling ignored property tests for monoids based on ByteString defined in FSharpx.Extras I stumbled upon this bug, ByteString being marked as struct results in it getting a "free" parameterless constructor that creates it with (null, 0, 0) (defaults for byte[] and int). This constructor is later used to implement ByteString.empty. The problem is that it does not play well with comparison and equality (it is based on comparison).

I added test cases that illustrate the issue. Solution finding in progress.

gdziadkiewicz commented 2 years ago

The tests are not being executed, see: https://github.com/fsprojects/FSharpx.Collections/actions/runs/2998970505/jobs/4812175674#step:7:307

gdziadkiewicz commented 2 years ago

The tests are not being executed, see: https://github.com/fsprojects/FSharpx.Collections/actions/runs/2998970505/jobs/4812175674#step:7:307

Fixing that in #192