Skip to content
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

Merged
merged 15 commits into from
Nov 18, 2015
Merged

Reproductive Rights #120

merged 15 commits into from
Nov 18, 2015

Conversation

CodaFi
Copy link
Member

@CodaFi CodaFi commented Nov 18, 2015

A partial solution to #116. Next step is to expose the Result type and give it a better name.

@@ -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))) }
Copy link
Member

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>?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! Good catch.

Copy link
Member

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
Copy link
Member

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.

@CodaFi
Copy link
Member Author

CodaFi commented Nov 18, 2015

CodaFi added a commit that referenced this pull request Nov 18, 2015
@CodaFi CodaFi merged commit 49e8195 into typelift:master Nov 18, 2015
@CodaFi CodaFi deleted the reproductive-rights branch November 18, 2015 23:53
@mpurland
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants