Add tests for moving unique boxes

Issue #409
This commit is contained in:
Brian Anderson 2011-09-22 15:43:08 -07:00
parent d174d917e2
commit dff4986f9e
6 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,4 @@
fn main() {
let i <- ~100;
assert *i == 100;
}

View File

@ -0,0 +1,5 @@
fn main() {
let i = ~100;
let j <- i;
assert *j == 100;
}

View File

@ -0,0 +1,8 @@
fn f(-i: ~int) {
assert *i == 100;
}
fn main() {
let i = ~100;
f(i);
}

View File

@ -0,0 +1,6 @@
fn main() {
let i = ~100;
let j = ~200;
let j <- i;
assert *j == 100;
}

View File

@ -0,0 +1,5 @@
fn main() {
let i;
i <- ~100;
assert *i == 100;
}

View File

@ -0,0 +1,6 @@
fn main() {
let i = ~100;
let j;
j <- i;
assert *j == 100;
}