forked from ntwilson/SafetyFirst
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issues ntwilson#33, ntwilson#34: *[.NonEmpty].init and .replicate, an…
…d some basic Numbers members
- Loading branch information
1 parent
4fdc6e0
commit 6ac8015
Showing
17 changed files
with
586 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module SafetyFirst.Specs.Generators | ||
|
||
open FsCheck | ||
open SafetyFirst.Numbers | ||
|
||
type Numbers = | ||
static member private gen_NaturalInt = gen { | ||
let! x = Arb.generate<int> | ||
return NaturalInt.assume (abs x) | ||
} | ||
static member NaturalIntGen() = { new Arbitrary<NaturalInt>() with override this.Generator = Numbers.gen_NaturalInt } | ||
|
||
static member private gen_PositiveInt = gen { | ||
let! t = Numbers.gen_NaturalInt | ||
return t.Increment | ||
} | ||
static member PositiveIntGen() = { new Arbitrary<PositiveInt>() with override this.Generator = Numbers.gen_PositiveInt } | ||
|
||
static member private gen_NegativeInt = gen { | ||
let! p = Numbers.gen_PositiveInt | ||
return p.Opposite | ||
} | ||
static member NegativeIntGen() = { new Arbitrary<NegativeInt>() with override this.Generator = Numbers.gen_NegativeInt } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.