moonbitlang/quickcheck/shrink does not have a README file
test {
// `Int` has a built-in Shrink instance that walks toward 0.
let candidates : Array[Int] = Shrink::shrink(100).collect()
assert_true(candidates.contains(0))
assert_true(candidates.length() > 0)
// `Bool` shrinks `true` to `false`, and `false` has no shrinks.
@debug.assert_eq(Shrink::shrink(true).collect(), [false])
@debug.assert_eq(Shrink::shrink(false).collect(), [])
}test {
assert_true(shrink_non_empty_array([1, 2, 3]).all(ys => ys.length() > 0))
}test {
let xs : @list.List[Int] = @list.from_array([5])
// Default list shrink would produce [], which is filtered out here.
assert_true(shrink_non_empty_list(xs).all(ys => !ys.is_empty()))
}Automatic testing of MoonBit programs