PageRenderTime 5ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/run-pass/opeq.rs

http://github.com/jruderman/rust
Rust | 19 lines | 15 code | 3 blank | 1 comment | 4 complexity | fde01a775df8c1ea49c684c183ae9d25 MD5 | raw file
 1
 2
 3
 4// -*- rust -*-
 5fn main() {
 6    let mut x: int = 1;
 7    x *= 2;
 8    log(debug, x);
 9    assert (x == 2);
10    x += 3;
11    log(debug, x);
12    assert (x == 5);
13    x *= x;
14    log(debug, x);
15    assert (x == 25);
16    x /= 5;
17    log(debug, x);
18    assert (x == 5);
19}