Skip to content

Commit b677bfe

Browse files
committed
Swap Result and Testable for better readme flow
1 parent 6215e8f commit b677bfe

2 files changed

Lines changed: 24 additions & 24 deletions

File tree

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,6 @@ Test a property, returning all test results as an array.
6060
The first argument is the _random seed_ to be passed to the random generator.
6161
The second argument is the number of tests to run.
6262

63-
#### `Result`
64-
65-
``` purescript
66-
data Result
67-
= Success
68-
| Failed String
69-
```
70-
71-
The result of a test: success or failure (with an error message).
72-
73-
#### `showResult`
74-
75-
``` purescript
76-
instance showResult :: Show Result
77-
```
78-
79-
8063
#### `Testable`
8164

8265
``` purescript
@@ -112,6 +95,23 @@ instance testableFunction :: (Arbitrary t, Testable prop) => Testable (t -> prop
11295
```
11396

11497

98+
#### `Result`
99+
100+
``` purescript
101+
data Result
102+
= Success
103+
| Failed String
104+
```
105+
106+
The result of a test: success or failure (with an error message).
107+
108+
#### `showResult`
109+
110+
``` purescript
111+
instance showResult :: Show Result
112+
```
113+
114+
115115
#### `(<?>)`
116116

117117
``` purescript

src/Test/QuickCheck.purs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,6 @@ quickCheckPure s = quickCheckPure' {newSeed: s, size: 10} where
7070
rest <- go (n - 1)
7171
return $ result : rest
7272

73-
-- | The result of a test: success or failure (with an error message).
74-
data Result = Success | Failed String
75-
76-
instance showResult :: Show Result where
77-
show Success = "Success"
78-
show (Failed msg) = "Failed: " ++ msg
79-
8073
-- | The `Testable` class represents _testable properties_.
8174
-- |
8275
-- | A testable property is a function of zero or more `Arbitrary` arguments,
@@ -98,6 +91,13 @@ instance testableFunction :: (Arbitrary t, Testable prop) => Testable (t -> prop
9891
t <- arbitrary
9992
test (f t)
10093

94+
-- | The result of a test: success or failure (with an error message).
95+
data Result = Success | Failed String
96+
97+
instance showResult :: Show Result where
98+
show Success = "Success"
99+
show (Failed msg) = "Failed: " ++ msg
100+
101101
-- | This operator attaches an error message to a failed test.
102102
-- |
103103
-- | For example:

0 commit comments

Comments
 (0)