mpizenberg / elm-test-rs

Fast and portable executable to run your Elm tests
BSD 3-Clause "New" or "Revised" License
80 stars 13 forks source link

use NonZeroU32 for --fuzz #77

Closed harrysarson closed 3 years ago

harrysarson commented 3 years ago

Current error message:

✦ ❯ elm-test-rs --fuzz 0                                                                                                                                  [19:43:07]
Error: Invalid --fuzz argument. It must be >= 1

With this change

✦ ❯ elm-test-rs --fuzz 0                                                                                                                                  [19:36:53]
Error: Invalid --fuzz value

Caused by:
    number would be zero for non-zero type

I am not sure this is a great improvement. I mainly wanted to "make impossible states impossible".

mpizenberg commented 3 years ago

I wasn't aware of that type ^^

mpizenberg commented 3 years ago

I've just added that it must be a positive integer in the error context since the default parsing error isn't very clear. So now we have

Error: Invalid --fuzz value. It must be a positive integer.

Caused by:
    number would be zero for non-zero type

And I think that should be fine!

mpizenberg commented 3 years ago

I'm not sure what that build error with musl is ... It's building fine on my machine :tm: Maybe that's a cache thing.