Skip to content

Support for struct tuples? #422

Closed
Closed

Description

@eiriktsarpalis

It seems that the latest prerelease of FsCheck is lacking support for struct tuple generation. I could provide an implementation for this, if I find the time.

Activity

  1. kurtschelfthout commented on Jan 16, 2018

    @kurtschelfthout
    Member

    Indeed, good point. I choose to interpret that as you're working on it until I hear otherwise ;-p

  2. eiriktsarpalis commented on Jan 27, 2018

    @eiriktsarpalis
    ContributorAuthor

    It seems like it should have worked OOTB, but failing due to bugs with struct tuples in FSharp.Reflection

  3. kurtschelfthout commented on Jan 29, 2018

    @kurtschelfthout
    Member

    Ah, that's unfortunate. If that would work, saves a dependency on ValueTuple nuget in some cases, right? Should we just add an explicit Arbitrary instance for now anyway?

  4. kurtschelfthout commented on Jun 17, 2018

    @kurtschelfthout
    Member

    Just noticed this actually works out of the box as long as you use an updated FSharp.Core with the fix mentioned above (I tested with NuGet FSharp.Core version 4.5.0):

        Arb.generate<struct (int*bool)> |> Gen.sample 10 10 |> printfn "%A"
        Arb.shrink (struct (15,1)) |> Seq.toArray |> printfn "%A"

    Both works. So I'm going to close PR #442 - don't think it's worth getting this to work for older FSharp.Core versions, and besides the redirect and packaging issues for FsCheck itself are giving me headaches.

    I consider this issue as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions