Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Improve quality of integer output #18

@Fresheyeball

Description

@Fresheyeball

This code:

func TestFoo(t *testing.T) {
    var i int
    fuzzy := fuzz.New()
    forN(100, func() {
        fuzzy.Fuzz(&i)
        log.Println(i)
    })
}

produces:

2015/09/04 12:35:09 -7835246273949666689
2015/09/04 12:35:09 -3335834746906823390
2015/09/04 12:35:09 -797614582871569465
2015/09/04 12:35:09 -1880490989454751177
2015/09/04 12:35:09 8642978877542446388
2015/09/04 12:35:09 7210419396307716596
2015/09/04 12:35:09 -1013781862395183072
2015/09/04 12:35:09 -6870665591055426828
2015/09/04 12:35:09 7613138460266199146
2015/09/04 12:35:09 -5153746402492891673
2015/09/04 12:35:09 810562363728706214
2015/09/04 12:35:09 -6642518234775288016
2015/09/04 12:35:09 -2591875516334598574
2015/09/04 12:35:09 -8510913015654777828
2015/09/04 12:35:09 4315878390670269427
2015/09/04 12:35:09 4755147220257554544
2015/09/04 12:35:09 -595777994041846809
2015/09/04 12:35:09 -3921103541046646506
2015/09/04 12:35:09 -2687620294811223767
2015/09/04 12:35:09 59623211572459200
2015/09/04 12:35:09 580834844145044863
2015/09/04 12:35:09 -7587201369927064342
2015/09/04 12:35:09 -8485154379888275139
2015/09/04 12:35:09 4417374548573622764
2015/09/04 12:35:09 -720185865975215166

Looks like ints never come out with an absolute value lower than one septillion, which is undesirable. I'd like to see an option to guarantee at-least one instance of zero as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions