Skip to content

Generate built-in Range聽#621

Description

@stijnmoreels

Hi! 馃憢
Was thinking of adding a built-in generator of the System.Range struct, as this would expand the default generator functionality.
Am currently using this:

let range = gen {
  let! min = Gen.choose (0, Int32.MaxValue)
  let! max = Gen.choose (min, Int32.MaxValue)
  return Range (min, max) }

To make sure that the minimum is always lower than the maximum. But, with some additional options, one could include Range.StartAt and Range.EndAt too.

Just a suggestion when using the awesome FsCheck library 馃槈 .

Activity

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