Skip to content

Commit b4a3a03

Browse files
committed
Changes for RC
1 parent 14286c6 commit b4a3a03

File tree

13 files changed

+115
-351
lines changed

13 files changed

+115
-351
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ bower install purescript-quickcheck
1212

1313
## Module documentation
1414

15-
- [Test.QuickCheck](docs/Test.QuickCheck.md)
16-
- [Test.QuickCheck.Arbitrary](docs/Test.QuickCheck.Arbitrary.md)
17-
- [Test.QuickCheck.Gen](docs/Test.QuickCheck.Gen.md)
18-
- [Test.QuickCheck.LCG](docs/Test.QuickCheck.LCG.md)
19-
- [Test.QuickCheck.Data.AlphaNumString](docs/Test.QuickCheck.Data.AlphaNumString.md)
20-
- [Test.QuickCheck.Data.ApproxNumber](docs/Test.QuickCheck.Data.ApproxNumber.md)
15+
- [Test.QuickCheck](docs/Test/QuickCheck.md)
16+
- [Test.QuickCheck.Arbitrary](docs/Test/QuickCheck/Arbitrary.md)
17+
- [Test.QuickCheck.Gen](docs/Test/QuickCheck/Gen.md)
18+
- [Test.QuickCheck.LCG](docs/Test/QuickCheck/LCG.md)
19+
- [Test.QuickCheck.Data.AlphaNumString](docs/Test/QuickCheck/Data/AlphaNumString.md)
20+
- [Test.QuickCheck.Data.ApproxNumber](docs/Test/QuickCheck/Data/ApproxNumber.md)

bower.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
"John A. De Goes <[email protected]> (http://degoes.net)",
66
"Phil Freeman <[email protected]>"
77
],
8+
"repository": {
9+
"type": "git",
10+
"url": "git://github.com/purescript/purescript-quickcheck.git"
11+
},
812
"ignore": [
913
"**/.*",
1014
"bower_components",
@@ -17,11 +21,14 @@
1721
"package.json"
1822
],
1923
"dependencies": {
20-
"purescript-random": "~0.2.0",
21-
"purescript-exceptions": "~0.3.0",
22-
"purescript-strings": "~0.5.0",
23-
"purescript-foldable-traversable": "~0.4.0",
24-
"purescript-console": "~0.1.0",
25-
"purescript-math": "~0.1.1"
24+
"purescript-random": "^0.2.0",
25+
"purescript-exceptions": "^0.3.0",
26+
"purescript-strings": "^0.5.0",
27+
"purescript-arrays": "^0.4.0",
28+
"purescript-lists": "^0.7.0",
29+
"purescript-either": "^0.2.0",
30+
"purescript-foldable-traversable": "^0.4.0",
31+
"purescript-console": "^0.1.0",
32+
"purescript-math": "^0.2.0"
2633
}
2734
}
Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
# Module Documentation
2-
31
## Module Test.QuickCheck
42

5-
63
This module is a partial port of the Haskell QuickCheck library.
74

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

2623
``` purescript
27-
type QC a = forall eff. Eff (err :: EXCEPTION, random :: RANDOM, console :: CONSOLE | eff) a
24+
type QC a = forall eff. Eff (console :: CONSOLE, random :: RANDOM, err :: EXCEPTION | eff) a
2825
```
2926

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

5451
``` purescript
55-
quickCheckPure :: forall prop. (Testable prop) => Int -> Int -> prop -> [Result]
52+
quickCheckPure :: forall prop. (Testable prop) => Int -> Int -> prop -> List Result
5653
```
5754

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

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

77-
#### `testableResult`
78-
74+
##### Instances
7975
``` purescript
8076
instance testableResult :: Testable Result
81-
```
82-
83-
84-
#### `testableBoolean`
85-
86-
``` purescript
8777
instance testableBoolean :: Testable Boolean
88-
```
89-
90-
91-
#### `testableFunction`
92-
93-
``` purescript
9478
instance testableFunction :: (Arbitrary t, Testable prop) => Testable (t -> prop)
9579
```
9680

97-
9881
#### `Result`
9982

10083
``` purescript
10184
data Result
102-
= Success
85+
= Success
10386
| Failed String
10487
```
10588

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

108-
#### `showResult`
109-
91+
##### Instances
11092
``` purescript
93+
instance testableResult :: Testable Result
11194
instance showResult :: Show Result
11295
```
11396

114-
11597
#### `(<?>)`
11698

11799
``` purescript
@@ -143,4 +125,3 @@ Self-documenting equality assertion
143125
Self-documenting inequality assertion
144126

145127

146-
Lines changed: 18 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Module Documentation
2-
31
## Module Test.QuickCheck.Arbitrary
42

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

17+
##### Instances
18+
``` purescript
19+
instance arbBoolean :: Arbitrary Boolean
20+
instance arbNumber :: Arbitrary Number
21+
instance arbInt :: Arbitrary Int
22+
instance arbString :: Arbitrary String
23+
instance arbChar :: Arbitrary Char
24+
instance arbUnit :: Arbitrary Unit
25+
instance arbOrdering :: Arbitrary Ordering
26+
instance arbArray :: (Arbitrary a) => Arbitrary (Array a)
27+
instance arbFunction :: (Coarbitrary a, Arbitrary b) => Arbitrary (a -> b)
28+
instance arbTuple :: (Arbitrary a, Arbitrary b) => Arbitrary (Tuple a b)
29+
instance arbMaybe :: (Arbitrary a) => Arbitrary (Maybe a)
30+
instance arbEither :: (Arbitrary a, Arbitrary b) => Arbitrary (Either a b)
31+
```
32+
1933
#### `Coarbitrary`
2034

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

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

35-
#### `arbBoolean`
36-
37-
``` purescript
38-
instance arbBoolean :: Arbitrary Boolean
39-
```
40-
41-
42-
#### `coarbBoolean`
43-
49+
##### Instances
4450
``` purescript
4551
instance coarbBoolean :: Coarbitrary Boolean
46-
```
47-
48-
49-
#### `arbNumber`
50-
51-
``` purescript
52-
instance arbNumber :: Arbitrary Number
53-
```
54-
55-
56-
#### `coarbNumber`
57-
58-
``` purescript
5952
instance coarbNumber :: Coarbitrary Number
60-
```
61-
62-
63-
#### `arbInt`
64-
65-
``` purescript
66-
instance arbInt :: Arbitrary Int
67-
```
68-
69-
70-
#### `coarbInt`
71-
72-
``` purescript
7353
instance coarbInt :: Coarbitrary Int
74-
```
75-
76-
77-
#### `arbString`
78-
79-
``` purescript
80-
instance arbString :: Arbitrary String
81-
```
82-
83-
84-
#### `coarbString`
85-
86-
``` purescript
8754
instance coarbString :: Coarbitrary String
88-
```
89-
90-
91-
#### `arbChar`
92-
93-
``` purescript
94-
instance arbChar :: Arbitrary Char
95-
```
96-
97-
98-
#### `coarbChar`
99-
100-
``` purescript
10155
instance coarbChar :: Coarbitrary Char
102-
```
103-
104-
105-
#### `arbUnit`
106-
107-
``` purescript
108-
instance arbUnit :: Arbitrary Unit
109-
```
110-
111-
112-
#### `coarbUnit`
113-
114-
``` purescript
11556
instance coarbUnit :: Coarbitrary Unit
116-
```
117-
118-
119-
#### `arbOrdering`
120-
121-
``` purescript
122-
instance arbOrdering :: Arbitrary Ordering
123-
```
124-
125-
126-
#### `coarbOrdering`
127-
128-
``` purescript
12957
instance coarbOrdering :: Coarbitrary Ordering
130-
```
131-
132-
133-
#### `arbArray`
134-
135-
``` purescript
136-
instance arbArray :: (Arbitrary a) => Arbitrary [a]
137-
```
138-
139-
140-
#### `coarbArray`
141-
142-
``` purescript
143-
instance coarbArray :: (Coarbitrary a) => Coarbitrary [a]
144-
```
145-
146-
147-
#### `arbFunction`
148-
149-
``` purescript
150-
instance arbFunction :: (Coarbitrary a, Arbitrary b) => Arbitrary (a -> b)
151-
```
152-
153-
154-
#### `coarbFunction`
155-
156-
``` purescript
58+
instance coarbArray :: (Coarbitrary a) => Coarbitrary (Array a)
15759
instance coarbFunction :: (Arbitrary a, Coarbitrary b) => Coarbitrary (a -> b)
158-
```
159-
160-
161-
#### `arbTuple`
162-
163-
``` purescript
164-
instance arbTuple :: (Arbitrary a, Arbitrary b) => Arbitrary (Tuple a b)
165-
```
166-
167-
168-
#### `coarbTuple`
169-
170-
``` purescript
17160
instance coarbTuple :: (Coarbitrary a, Coarbitrary b) => Coarbitrary (Tuple a b)
172-
```
173-
174-
175-
#### `arbMaybe`
176-
177-
``` purescript
178-
instance arbMaybe :: (Arbitrary a) => Arbitrary (Maybe a)
179-
```
180-
181-
182-
#### `coarbMaybe`
183-
184-
``` purescript
18561
instance coarbMaybe :: (Coarbitrary a) => Coarbitrary (Maybe a)
186-
```
187-
188-
189-
#### `arbEither`
190-
191-
``` purescript
192-
instance arbEither :: (Arbitrary a, Arbitrary b) => Arbitrary (Either a b)
193-
```
194-
195-
196-
#### `coarbEither`
197-
198-
``` purescript
19962
instance coarbEither :: (Coarbitrary a, Coarbitrary b) => Coarbitrary (Either a b)
20063
```
20164

20265

203-
204-
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Module Documentation
2-
31
## Module Test.QuickCheck.Data.AlphaNumString
42

53
#### `AlphaNumString`
@@ -12,19 +10,16 @@ newtype AlphaNumString
1210
A newtype for `String` whose `Arbitrary` instance generated random
1311
alphanumeric strings.
1412

15-
#### `arbAlphaNumString`
16-
13+
##### Instances
1714
``` purescript
1815
instance arbAlphaNumString :: Arbitrary AlphaNumString
16+
instance coarbAlphaNumString :: Coarbitrary AlphaNumString
1917
```
2018

21-
22-
#### `coarbAlphaNumString`
19+
#### `runAlphaNumString`
2320

2421
``` purescript
25-
instance coarbAlphaNumString :: Coarbitrary AlphaNumString
22+
runAlphaNumString :: AlphaNumString -> String
2623
```
2724

2825

29-
30-

0 commit comments

Comments
 (0)