aboutsummaryrefslogtreecommitdiff
path: root/primrose/spec_code/b_asc_con.rs
blob: 5189dddbab43f57b63b61ea713161aa8ab33500b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*SPEC*
property ascending<T> {
    \c -> ((for-all-consecutive-pairs c) leq?)
}
type AscendingCon<T> = {c impl (Container) | (ascending c)}
*ENDSPEC*/

fn main () {
    let mut c = AscendingCon::<u32>::new();
    for x in 0..10 {
        c.insert(x);
        c.insert(x);
    }
    assert_eq!(c.len(), 20);
}