aa25f22f19
This giant commit changes the syntax of Rust to use "assert" for "check" expressions that didn't mean anything to the typestate system, and continue using "check" for checks that are used as part of typestate checking. Most of the changes are just replacing "check" with "assert" in test cases and rustc.
32 lines
562 B
Rust
32 lines
562 B
Rust
fn main() -> () {
|
|
test00();
|
|
}
|
|
|
|
fn test00() {
|
|
let int r = 0;
|
|
let int sum = 0;
|
|
let port[int] p = port();
|
|
let chan[int] c = chan(p);
|
|
|
|
c <| 1;
|
|
c <| 2;
|
|
c <| 3;
|
|
c <| 4;
|
|
|
|
r <- p; sum += r; log (r);
|
|
r <- p; sum += r; log (r);
|
|
r <- p; sum += r; log (r);
|
|
r <- p; sum += r; log (r);
|
|
|
|
c <| 5;
|
|
c <| 6;
|
|
c <| 7;
|
|
c <| 8;
|
|
|
|
r <- p; sum += r; log (r);
|
|
r <- p; sum += r; log (r);
|
|
r <- p; sum += r; log (r);
|
|
r <- p; sum += r; log (r);
|
|
|
|
assert (sum == 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8);
|
|
} |