Skip to content

Commit

Permalink
Changes for RC
Browse files Browse the repository at this point in the history
  • Loading branch information
paf31 committed Jun 10, 2015
1 parent 14286c6 commit b4a3a03
Show file tree
Hide file tree
Showing 13 changed files with 115 additions and 351 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ bower install purescript-quickcheck

## Module documentation

- [Test.QuickCheck](docs/Test.QuickCheck.md)
- [Test.QuickCheck.Arbitrary](docs/Test.QuickCheck.Arbitrary.md)
- [Test.QuickCheck.Gen](docs/Test.QuickCheck.Gen.md)
- [Test.QuickCheck.LCG](docs/Test.QuickCheck.LCG.md)
- [Test.QuickCheck.Data.AlphaNumString](docs/Test.QuickCheck.Data.AlphaNumString.md)
- [Test.QuickCheck.Data.ApproxNumber](docs/Test.QuickCheck.Data.ApproxNumber.md)
- [Test.QuickCheck](docs/Test/QuickCheck.md)
- [Test.QuickCheck.Arbitrary](docs/Test/QuickCheck/Arbitrary.md)
- [Test.QuickCheck.Gen](docs/Test/QuickCheck/Gen.md)
- [Test.QuickCheck.LCG](docs/Test/QuickCheck/LCG.md)
- [Test.QuickCheck.Data.AlphaNumString](docs/Test/QuickCheck/Data/AlphaNumString.md)
- [Test.QuickCheck.Data.ApproxNumber](docs/Test/QuickCheck/Data/ApproxNumber.md)
19 changes: 13 additions & 6 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"John A. De Goes <john@degoes.net> (http://degoes.net)",
"Phil Freeman <freeman.phil@gmail.com>"
],
"repository": {
"type": "git",
"url": "git://github.com/purescript/purescript-quickcheck.git"
},
"ignore": [
"**/.*",
"bower_components",
Expand All @@ -17,11 +21,14 @@
"package.json"
],
"dependencies": {
"purescript-random": "~0.2.0",
"purescript-exceptions": "~0.3.0",
"purescript-strings": "~0.5.0",
"purescript-foldable-traversable": "~0.4.0",
"purescript-console": "~0.1.0",
"purescript-math": "~0.1.1"
"purescript-random": "^0.2.0",
"purescript-exceptions": "^0.3.0",
"purescript-strings": "^0.5.0",
"purescript-arrays": "^0.4.0",
"purescript-lists": "^0.7.0",
"purescript-either": "^0.2.0",
"purescript-foldable-traversable": "^0.4.0",
"purescript-console": "^0.1.0",
"purescript-math": "^0.2.0"
}
}
31 changes: 6 additions & 25 deletions docs/Test.QuickCheck.md → docs/Test/QuickCheck.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Module Documentation

## Module Test.QuickCheck


This module is a partial port of the Haskell QuickCheck library.

QuickCheck provides a way to write _property-based_ tests.
Expand All @@ -24,7 +21,7 @@ main = quickCheck \n -> n + 1 > n
#### `QC`

``` purescript
type QC a = forall eff. Eff (err :: EXCEPTION, random :: RANDOM, console :: CONSOLE | eff) a
type QC a = forall eff. Eff (console :: CONSOLE, random :: RANDOM, err :: EXCEPTION | eff) a
```

A type synonym which represents the effects used by the `quickCheck` function.
Expand Down Expand Up @@ -52,7 +49,7 @@ representing the number of tests which should be run.
#### `quickCheckPure`

``` purescript
quickCheckPure :: forall prop. (Testable prop) => Int -> Int -> prop -> [Result]
quickCheckPure :: forall prop. (Testable prop) => Int -> Int -> prop -> List Result
```

Test a property, returning all test results as an array.
Expand All @@ -74,44 +71,29 @@ returning a `Boolean` or `Result`.

Testable properties can be passed to the `quickCheck` function.

#### `testableResult`

##### Instances
``` purescript
instance testableResult :: Testable Result
```


#### `testableBoolean`

``` purescript
instance testableBoolean :: Testable Boolean
```


#### `testableFunction`

``` purescript
instance testableFunction :: (Arbitrary t, Testable prop) => Testable (t -> prop)
```


#### `Result`

``` purescript
data Result
= Success
= Success
| Failed String
```

The result of a test: success or failure (with an error message).

#### `showResult`

##### Instances
``` purescript
instance testableResult :: Testable Result
instance showResult :: Show Result
```


#### `(<?>)`

``` purescript
Expand Down Expand Up @@ -143,4 +125,3 @@ Self-documenting equality assertion
Self-documenting inequality assertion



175 changes: 18 additions & 157 deletions docs/Test.QuickCheck.Arbitrary.md → docs/Test/QuickCheck/Arbitrary.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Module Documentation

## Module Test.QuickCheck.Arbitrary

#### `Arbitrary`
Expand All @@ -16,6 +14,22 @@ _randomly-generated_.
the type `t`. Combinators in the `Test.QuickCheck.Gen`
module can be used to construct random generators.

##### Instances
``` purescript
instance arbBoolean :: Arbitrary Boolean
instance arbNumber :: Arbitrary Number
instance arbInt :: Arbitrary Int
instance arbString :: Arbitrary String
instance arbChar :: Arbitrary Char
instance arbUnit :: Arbitrary Unit
instance arbOrdering :: Arbitrary Ordering
instance arbArray :: (Arbitrary a) => Arbitrary (Array a)
instance arbFunction :: (Coarbitrary a, Arbitrary b) => Arbitrary (a -> b)
instance arbTuple :: (Arbitrary a, Arbitrary b) => Arbitrary (Tuple a b)
instance arbMaybe :: (Arbitrary a) => Arbitrary (Maybe a)
instance arbEither :: (Arbitrary a, Arbitrary b) => Arbitrary (Either a b)
```

#### `Coarbitrary`

``` purescript
Expand All @@ -32,173 +46,20 @@ is the role of the `coarbitrary` function.

`Coarbitrary` instances can be written using the `perturbGen` function.

#### `arbBoolean`

``` purescript
instance arbBoolean :: Arbitrary Boolean
```


#### `coarbBoolean`

##### Instances
``` purescript
instance coarbBoolean :: Coarbitrary Boolean
```


#### `arbNumber`

``` purescript
instance arbNumber :: Arbitrary Number
```


#### `coarbNumber`

``` purescript
instance coarbNumber :: Coarbitrary Number
```


#### `arbInt`

``` purescript
instance arbInt :: Arbitrary Int
```


#### `coarbInt`

``` purescript
instance coarbInt :: Coarbitrary Int
```


#### `arbString`

``` purescript
instance arbString :: Arbitrary String
```


#### `coarbString`

``` purescript
instance coarbString :: Coarbitrary String
```


#### `arbChar`

``` purescript
instance arbChar :: Arbitrary Char
```


#### `coarbChar`

``` purescript
instance coarbChar :: Coarbitrary Char
```


#### `arbUnit`

``` purescript
instance arbUnit :: Arbitrary Unit
```


#### `coarbUnit`

``` purescript
instance coarbUnit :: Coarbitrary Unit
```


#### `arbOrdering`

``` purescript
instance arbOrdering :: Arbitrary Ordering
```


#### `coarbOrdering`

``` purescript
instance coarbOrdering :: Coarbitrary Ordering
```


#### `arbArray`

``` purescript
instance arbArray :: (Arbitrary a) => Arbitrary [a]
```


#### `coarbArray`

``` purescript
instance coarbArray :: (Coarbitrary a) => Coarbitrary [a]
```


#### `arbFunction`

``` purescript
instance arbFunction :: (Coarbitrary a, Arbitrary b) => Arbitrary (a -> b)
```


#### `coarbFunction`

``` purescript
instance coarbArray :: (Coarbitrary a) => Coarbitrary (Array a)
instance coarbFunction :: (Arbitrary a, Coarbitrary b) => Coarbitrary (a -> b)
```


#### `arbTuple`

``` purescript
instance arbTuple :: (Arbitrary a, Arbitrary b) => Arbitrary (Tuple a b)
```


#### `coarbTuple`

``` purescript
instance coarbTuple :: (Coarbitrary a, Coarbitrary b) => Coarbitrary (Tuple a b)
```


#### `arbMaybe`

``` purescript
instance arbMaybe :: (Arbitrary a) => Arbitrary (Maybe a)
```


#### `coarbMaybe`

``` purescript
instance coarbMaybe :: (Coarbitrary a) => Coarbitrary (Maybe a)
```


#### `arbEither`

``` purescript
instance arbEither :: (Arbitrary a, Arbitrary b) => Arbitrary (Either a b)
```


#### `coarbEither`

``` purescript
instance coarbEither :: (Coarbitrary a, Coarbitrary b) => Coarbitrary (Either a b)
```




Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Module Documentation

## Module Test.QuickCheck.Data.AlphaNumString

#### `AlphaNumString`
Expand All @@ -12,19 +10,16 @@ newtype AlphaNumString
A newtype for `String` whose `Arbitrary` instance generated random
alphanumeric strings.

#### `arbAlphaNumString`

##### Instances
``` purescript
instance arbAlphaNumString :: Arbitrary AlphaNumString
instance coarbAlphaNumString :: Coarbitrary AlphaNumString
```


#### `coarbAlphaNumString`
#### `runAlphaNumString`

``` purescript
instance coarbAlphaNumString :: Coarbitrary AlphaNumString
runAlphaNumString :: AlphaNumString -> String
```




Loading

0 comments on commit b4a3a03

Please sign in to comment.