9110 shaares
215 private links
215 private links
To improve testing: throws many test and get a way to verify the output is correct.
For example, sorting numbers by ascending order should results in
for i in 1..output.len() {
assert!(
output[i - 1] <= output[i],
"input {input:?} failed at index {i}, output {output:?}",
);
}
Then implement a shrinker to reduce the list to the smallest possible error. Better
input [58, 33] failed at index 1, output [58, 33]
than an array of 200 elements.
TODO: https://sunshowers.io/posts/monads-through-pbt/#2-drawing-the-rest-of-the-owl