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

/src/test/run-pass/vec-growth.rs

http://github.com/jruderman/rust
Rust | 14 lines | 12 code | 2 blank | 0 comment | 5 complexity | 6ef8c339e859a5cc6ff6356e9c6bf209 MD5 | raw file
 1
 2
 3fn main() {
 4    let mut v = ~[1];
 5    v += ~[2];
 6    v += ~[3];
 7    v += ~[4];
 8    v += ~[5];
 9    assert (v[0] == 1);
10    assert (v[1] == 2);
11    assert (v[2] == 3);
12    assert (v[3] == 4);
13    assert (v[4] == 5);
14}