parent
4fba02c7e9
commit
f99cf2d62f
6
src/test/run-fail/unwind-assert.rs
Normal file
6
src/test/run-fail/unwind-assert.rs
Normal file
@ -0,0 +1,6 @@
|
||||
// error-pattern:fail
|
||||
|
||||
fn main() {
|
||||
let a = @0;
|
||||
assert false;
|
||||
}
|
8
src/test/run-fail/unwind-check.rs
Normal file
8
src/test/run-fail/unwind-check.rs
Normal file
@ -0,0 +1,8 @@
|
||||
// error-pattern:fail
|
||||
|
||||
pure fn p(a: @int) -> bool { false }
|
||||
|
||||
fn main() {
|
||||
let a = @0;
|
||||
check p(a);
|
||||
}
|
10
src/test/run-fail/unwind-closure.rs
Normal file
10
src/test/run-fail/unwind-closure.rs
Normal file
@ -0,0 +1,10 @@
|
||||
// error-pattern:fail
|
||||
|
||||
fn f(a: @int) {
|
||||
fail;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let g = bind f(@0);
|
||||
g();
|
||||
}
|
7
src/test/run-fail/unwind-initializer.rs
Normal file
7
src/test/run-fail/unwind-initializer.rs
Normal file
@ -0,0 +1,7 @@
|
||||
// error-pattern:fail
|
||||
|
||||
fn main() {
|
||||
let a: @int = {
|
||||
fail;
|
||||
};
|
||||
}
|
12
src/test/run-fail/unwind-iter.rs
Normal file
12
src/test/run-fail/unwind-iter.rs
Normal file
@ -0,0 +1,12 @@
|
||||
// error-pattern:fail
|
||||
|
||||
iter x() -> int {
|
||||
fail;
|
||||
put 0;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let a = @0;
|
||||
for each x in x() {
|
||||
}
|
||||
}
|
11
src/test/run-fail/unwind-nested.rs
Normal file
11
src/test/run-fail/unwind-nested.rs
Normal file
@ -0,0 +1,11 @@
|
||||
// error-pattern:fail
|
||||
|
||||
fn main() {
|
||||
let a = @0;
|
||||
{
|
||||
let b = @0;
|
||||
{
|
||||
fail;
|
||||
}
|
||||
}
|
||||
}
|
16
src/test/run-fail/unwind-stacked.rs
Normal file
16
src/test/run-fail/unwind-stacked.rs
Normal file
@ -0,0 +1,16 @@
|
||||
// error-pattern:fail
|
||||
|
||||
fn f() {
|
||||
let a = @0;
|
||||
fail;
|
||||
}
|
||||
|
||||
fn g() {
|
||||
let b = @0;
|
||||
f();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let a = @0;
|
||||
g();
|
||||
}
|
10
src/test/run-fail/unwind-uninitialized.rs
Normal file
10
src/test/run-fail/unwind-uninitialized.rs
Normal file
@ -0,0 +1,10 @@
|
||||
// error-pattern:fail
|
||||
|
||||
fn f() {
|
||||
fail;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
f();
|
||||
let a = @0;
|
||||
}
|
13
src/test/run-pass/unwind-box.rs
Normal file
13
src/test/run-pass/unwind-box.rs
Normal file
@ -0,0 +1,13 @@
|
||||
use std;
|
||||
import std::task;
|
||||
|
||||
fn f() {
|
||||
task::unsupervise();
|
||||
let a = @0;
|
||||
fail;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let g = f;
|
||||
task::spawn(g);
|
||||
}
|
20
src/test/run-pass/unwind-resource.rs
Normal file
20
src/test/run-pass/unwind-resource.rs
Normal file
@ -0,0 +1,20 @@
|
||||
use std;
|
||||
import std::task;
|
||||
import std::comm;
|
||||
|
||||
resource complainer(c: comm::chan<bool>) {
|
||||
comm::send(c, true);
|
||||
}
|
||||
|
||||
fn f(c: -comm::chan<bool>) {
|
||||
task::unsupervise();
|
||||
let c <- complainer(c);
|
||||
fail;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let p = comm::port();
|
||||
let c = comm::chan(p);
|
||||
task::spawn(bind f(c));
|
||||
assert comm::recv(p);
|
||||
}
|
17
src/test/run-pass/unwind-resource2.rs
Normal file
17
src/test/run-pass/unwind-resource2.rs
Normal file
@ -0,0 +1,17 @@
|
||||
use std;
|
||||
import std::task;
|
||||
import std::comm;
|
||||
|
||||
resource complainer(c: @int) {
|
||||
}
|
||||
|
||||
fn f() {
|
||||
task::unsupervise();
|
||||
let c <- complainer(@0);
|
||||
fail;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let g = f;
|
||||
task::spawn(g);
|
||||
}
|
Loading…
Reference in New Issue
Block a user