Skip to content

Feature request: Add nilable or maybe function #220

Description

@Munksgaard

This is a minor thing, but I find myself writing StreamData.one_of([nil, some_other_generator]) quite a lot. Would there be interest in a PR that adds a StreamData.maybe/1 generator that makes another generator nilable?

Of course, there's a discussion about what the right distribution of values should be here. The simple one_of from above makes it so that nil is returned 50% of the time, which may or may not be the desired outcome. Feedback welcome!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions