-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reproductive Rights #120
Reproductive Rights #120
Conversation
@@ -146,7 +144,7 @@ extension Int64 : Arbitrary { | |||
|
|||
extension UInt : Arbitrary { | |||
public static var arbitrary : Gen<UInt> { | |||
return Gen.sized { n in Gen<UInt>.pure(UInt(arc4random_uniform(UInt32(abs(n))))) } | |||
return Gen.sized { n in Gen<UInt64>.choose((0, UInt(n))) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be Gen<UInt>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! Good catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -198,12 +196,20 @@ extension UInt64 : Arbitrary { | |||
|
|||
extension Float : Arbitrary { | |||
public static var arbitrary : Gen<Float> { | |||
return Gen.sized({ n in | |||
#if !(arch(x86_64) || arch(arm64)) | |||
let precision : Int = 999999999 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if this was defined as a constant somewhere.
⛵ |
👍 |
A partial solution to #116. Next step is to expose the
Result
type and give it a better name.