|
98 | 98 | :result-data {...}
|
99 | 99 | :seed 42}
|
100 | 100 |
|
101 |
| - It will also be called on :complete, :shrink-step and :shrunk. |
| 101 | + It will also be called on :complete, :shrink-step and :shrunk. Many |
| 102 | + of the keys also appear in the quick-check return value, and are |
| 103 | + documented below. |
| 104 | +
|
| 105 | + If the test passes, the return value will be something like: |
| 106 | +
|
| 107 | + {:num-tests 100, |
| 108 | + :pass? true, |
| 109 | + :result true, |
| 110 | + :seed 1561826505982, |
| 111 | + :time-elapsed-ms 24} |
| 112 | +
|
| 113 | + If the test fails, the return value will be something like: |
| 114 | +
|
| 115 | + {:fail [0], |
| 116 | + :failed-after-ms 0, |
| 117 | + :failing-size 0, |
| 118 | + :num-tests 1, |
| 119 | + :pass? false, |
| 120 | + :result false, |
| 121 | + :result-data nil, |
| 122 | + :seed 1561826506080, |
| 123 | + :shrunk |
| 124 | + {:depth 0, |
| 125 | + :pass? false, |
| 126 | + :result false, |
| 127 | + :result-data nil, |
| 128 | + :smallest [0], |
| 129 | + :time-shrinking-ms 0, |
| 130 | + :total-nodes-visited 0}} |
| 131 | +
|
| 132 | + The meaning of the individual entries is: |
| 133 | +
|
| 134 | + :num-tests |
| 135 | + The total number of trials that was were run, not including |
| 136 | + shrinking (if applicable) |
| 137 | +
|
| 138 | + :pass? |
| 139 | + A boolean indicating whether the test passed or failed |
| 140 | +
|
| 141 | + :result |
| 142 | + A legacy entry that is similar to :pass? |
| 143 | +
|
| 144 | + :seed |
| 145 | + The seed used for the entire test run; can be used to reproduce |
| 146 | + a test run by passing it as the :seed option to quick-check |
| 147 | +
|
| 148 | + :time-elapsed-ms |
| 149 | + The total time, in milliseconds, of a successful test run |
| 150 | +
|
| 151 | + :fail |
| 152 | + The generated values for the first failure; note that this is |
| 153 | + always a vector, since prop/for-all can have multiple clauses |
| 154 | +
|
| 155 | + :failed-after-ms |
| 156 | + The total time, in milliseconds, spent finding the first failing |
| 157 | + trial |
| 158 | +
|
| 159 | + :failing-size |
| 160 | + The value of the size parameter used to generate the first |
| 161 | + failure |
| 162 | +
|
| 163 | + :result-data |
| 164 | + The result data, if any, of the first failing trial (to take |
| 165 | + advantage of this a property must return an object satisfying |
| 166 | + the clojure.test.check.results/Result protocol) |
| 167 | +
|
| 168 | + :shrunk |
| 169 | + A map of data about the shrinking process; nested keys that |
| 170 | + appear at the top level have the same meaning; other keys are |
| 171 | + documented next |
| 172 | +
|
| 173 | + :shrunk / :depth |
| 174 | + The depth in the shrink tree that the smallest failing instance |
| 175 | + was found; this is essentially the idea of how many times the |
| 176 | + original failure was successfully shrunk |
| 177 | +
|
| 178 | + :smallest |
| 179 | + The smallest values found in the shrinking process that still |
| 180 | + fail the test; this is a vector of the same type as :fail |
| 181 | +
|
| 182 | + :time-shrinking-ms |
| 183 | + The total time, in milliseconds, spent shrinking |
| 184 | +
|
| 185 | + :total-nodes-visited |
| 186 | + The total number of steps in the shrinking process |
102 | 187 |
|
103 | 188 | Examples:
|
104 | 189 |
|
|
0 commit comments