Skip to content

Commit 624fbbd

Browse files
committed
Update and un-xfail tests
1 parent 12a4130 commit 624fbbd

5 files changed

+37
-33
lines changed

src/test/run-fail/fail-parens.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// xfail-test
21
// Fail statements without arguments need to be disambiguated in
32
// certain positions
4-
// error-pattern:explicit-failure
3+
// error-pattern:oops
54

65
fn bigfail() {
7-
do { while (fail) { if (fail) {
8-
match (fail) { _ {
9-
}}
10-
}}} while fail;
6+
while (fail ~"oops") { if (fail) {
7+
match (fail) { () => {
8+
}
9+
}
10+
}};
1111
}
1212

1313
fn main() { bigfail(); }
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
// error-pattern:ran out of stack
2-
// xfail-test - right now we leak when we fail during failure
32

43
// Test that the task fails after hiting the recursion limit
5-
// durnig unwinding
4+
// during unwinding
65

76
fn recurse() {
87
log(debug, "don't optimize me out");
98
recurse();
109
}
1110

12-
class r {
13-
let recursed: *mut bool;
14-
new(recursed: *mut bool) unsafe { self.recursed = recursed; }
15-
drop unsafe {
16-
if !*recursed {
17-
*recursed = true;
18-
recurse();
11+
struct r {
12+
recursed: *mut bool,
13+
drop unsafe {
14+
if !*(self.recursed) {
15+
*(self.recursed) = true;
16+
recurse();
17+
}
1918
}
20-
}
19+
}
20+
21+
fn r(recursed: *mut bool) -> r unsafe {
22+
r { recursed: recursed }
2123
}
2224

2325
fn main() {
2426
let mut recursed = false;
25-
let _r = r(ptr::mut_addr_of(recursed));
27+
let _r = r(ptr::mut_addr_of(&recursed));
2628
recurse();
2729
}

src/test/run-fail/unwind-resource-fail.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
// error-pattern:fail
2-
// xfail-test
1+
// error-pattern:squirrel
32

4-
class r {
5-
new(i:int) {}
6-
drop { fail; }
3+
struct r {
4+
i: int,
5+
drop { fail ~"squirrel" }
76
}
87

8+
fn r(i: int) -> r { r { i: i } }
9+
910
fn main() {
1011
@0;
1112
let r = move r(0);

src/test/run-fail/unwind-resource-fail2.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
// error-pattern:fail
2-
// xfail-test
1+
// error-pattern:wombat
32

4-
class r {
5-
new(i:int) {}
6-
drop { fail; }
3+
struct r {
4+
i: int,
5+
drop { fail ~"wombat" }
76
}
87

8+
fn r(i: int) -> r { r { i: i } }
9+
910
fn main() {
1011
@0;
1112
let r = move r(0);

src/test/run-fail/unwind-resource-fail3.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// error-pattern:quux
2-
// xfail-test
32

4-
class faily_box {
5-
let i: @int;
6-
new(i: @int) { self.i = i; }
7-
// What happens to the box pointer owned by this class?
3+
struct faily_box {
4+
i: @int
85
}
6+
// What happens to the box pointer owned by this class?
7+
8+
fn faily_box(i: @int) -> faily_box { faily_box { i: i } }
99

1010
impl faily_box : Drop {
1111
fn finalize() {
12-
fail "quux";
12+
fail ~"quux";
1313
}
1414
}
1515

0 commit comments

Comments
 (0)