-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathliterals.rs
68 lines (56 loc) · 1.42 KB
/
literals.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#![feature(rustc_private)]
#[macro_use]
mod common;
use common::*;
test_verify_one_file! {
#[test] set_literal_0 verus_code! {
#[allow(unused)]
use vstd::set::*;
proof fn sl() {
let s1: Set<int> = set![];
let s2: Set<int> = set![];
assert(s1 =~= s2);
}
} => Ok(())
}
test_verify_one_file! {
#[test] set_literal_1 verus_code! {
#[allow(unused)]
use vstd::set::*;
proof fn sl() {
let s1 = set![2int];
let s2 = set![2int];
assert(s1 =~= s2);
}
} => Ok(())
}
test_verify_one_file! {
#[test] set_literal_2 verus_code! {
#[allow(unused)]
use vstd::set::*;
proof fn sl() {
let s1: Set<int> = set![2, 4];
let s2: Set<int> = set![4, 2];
assert(s1 =~= s2);
}
proof fn comma_at_end() {
let s1: Set<int> = set![2, 4,];
let s2: Set<int> = set![4, 2,];
assert(s1 =~= s2);
}
} => Ok(())
}
test_verify_one_file! {
#[test] seq_literals verus_code! {
#[allow(unused)]
use vstd::seq::*;
proof fn sl() {
let s1: Seq<int> = seq![2, 4, 6, 8, 10];
assert(s1.index(2) == 6);
}
proof fn comma_at_end() {
let s1: Seq<int> = seq![2, 4, 6, 8, 10,];
assert(s1.index(2) == 6);
}
} => Ok(())
}