-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Example
///|
fn prop_deque(deque : (Deque, Int)) -> Bool {
println("input: \{deque}")
let (deque, n) = deque
deque._.truncate(n)
guard n < 0 || deque._.length() <= n else { return false }
guard n > 0 || deque._.is_empty() else { return false }
true
}
///|
type Deque @deque.T[Int] derive(Show)
///|
impl @quickcheck.Arbitrary for Deque with arbitrary(i, randomstate) {
@deque.from_array(Array::arbitrary(i, randomstate))
}
test {
@lib.quick_check_fn!(prop_deque)
}Test with Core 532f2e8e4c5e041ba695c24ca69a50cc0005d7bd (where truncate has a bug)
Expected Output
*** [5/0/100] Failed! Falsified.
(Deque(@deque.of([])), -2)
Actual Output
*** [5/0/100] Failed! Falsified.
(Deque(@deque.of([])), 0)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request