quickcheck 0.8.5

Automatic property based testing with shrinking.
Documentation
extern crate quickcheck;

use quickcheck::{TestResult, quickcheck};

fn main() {
    fn prop(length: usize, index: usize) -> TestResult {
        let v: Vec<_> = (0..length).collect();
        if index < length {
            TestResult::discard()
        } else {
            TestResult::must_fail(move || {
                v[index]
            })
        }
    }
    quickcheck(prop as fn(usize, usize) -> TestResult);
}