Skip to content

Commit e9622f0

Browse files
committed
Remove match check from test cases
1 parent 01a5845 commit e9622f0

22 files changed

+57
-39
lines changed

src/test/bench/task-perf-one-million.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,29 @@ fn calc(children: uint, parent_ch: comm::Chan<msg>) {
1919
}
2020

2121
for iter::repeat (children) {
22-
match check comm::recv(port) {
22+
match comm::recv(port) {
2323
ready(child_ch) => {
2424
vec::push(child_chs, child_ch);
2525
}
26+
_ => fail ~"task-perf-one-million failed (port not ready)"
2627
}
2728
}
2829

2930
comm::send(parent_ch, ready(chan));
3031

31-
match check comm::recv(port) {
32+
match comm::recv(port) {
3233
start => {
3334
do vec::iter (child_chs) |child_ch| {
3435
comm::send(child_ch, start);
3536
}
3637
}
38+
_ => fail ~"task-perf-one-million failed (port not in start state)"
3739
}
3840

3941
for iter::repeat (children) {
40-
match check comm::recv(port) {
42+
match comm::recv(port) {
4143
done(child_sum) => { sum += child_sum; }
44+
_ => fail ~"task-perf-one-million failed (port not done)"
4245
}
4346
}
4447

@@ -60,13 +63,15 @@ fn main(args: ~[~str]) {
6063
do task::spawn {
6164
calc(children, chan);
6265
};
63-
match check comm::recv(port) {
66+
match comm::recv(port) {
6467
ready(chan) => {
6568
comm::send(chan, start);
6669
}
70+
_ => fail ~"task-perf-one-million failed (port not ready)"
6771
}
68-
let sum = match check comm::recv(port) {
72+
let sum = match comm::recv(port) {
6973
done(sum) => { sum }
74+
_ => fail ~"task-perf-one-million failed (port not done)"
7075
};
7176
error!("How many tasks? %d tasks.", sum);
7277
}

src/test/compile-fail/alt-range-fail-dominate.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,33 @@
55
//error-pattern: unreachable
66

77
fn main() {
8-
match check 5u {
8+
match 5u {
99
1u to 10u => { }
1010
5u to 6u => { }
11+
_ => {}
1112
};
1213

13-
match check 5u {
14+
match 5u {
1415
3u to 6u => { }
1516
4u to 6u => { }
17+
_ => {}
1618
};
1719

18-
match check 5u {
20+
match 5u {
1921
4u to 6u => { }
2022
4u to 6u => { }
23+
_ => {}
2124
};
2225

23-
match check 'c' {
26+
match 'c' {
2427
'A' to 'z' => {}
2528
'a' to 'z' => {}
29+
_ => {}
2630
};
2731

28-
match check 1.0 {
32+
match 1.0 {
2933
0.01 to 6.5 => {}
3034
0.02 => {}
35+
_ => {}
3136
};
3237
}

src/test/compile-fail/borrowck-no-cycle-in-exchange-heap.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ enum cycle {
55
fn main() {
66
let x = ~node({mut a: ~empty});
77
// Create a cycle!
8-
match check *x { //~ NOTE loan of immutable local variable granted here
8+
match *x { //~ NOTE loan of immutable local variable granted here
99
node(ref y) => {
1010
y.a <- x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
1111
}
12+
empty => {}
1213
};
1314
}

src/test/compile-fail/liveness-missing-ret2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
fn f() -> int {
44
// Make sure typestate doesn't interpreturn this match expression
55
// as the function result
6-
match check true { true => { } };
6+
match true { true => { } _ => {} };
77
}
88

99
fn main() { }

src/test/pretty/block-disambig.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn test2() -> int { let val = @0; { } *val }
88

99
fn test3() {
1010
let regs = @{mut eax: 0};
11-
match check true { true => { } }
11+
match true { true => { } _ => { } }
1212
(*regs).eax = 1;
1313
}
1414

@@ -20,14 +20,15 @@ fn test6() -> bool { { } (true || false) && true }
2020

2121
fn test7() -> uint {
2222
let regs = @0;
23-
match check true { true => { } }
23+
match true { true => { } _ => { } }
2424
(*regs < 2) as uint
2525
}
2626

2727
fn test8() -> int {
2828
let val = @0;
29-
match check true {
29+
match true {
3030
true => { }
31+
_ => { }
3132
}
3233
if *val < 1 {
3334
0
@@ -36,11 +37,11 @@ fn test8() -> int {
3637
}
3738
}
3839

39-
fn test9() { let regs = @mut 0; match check true { true => { } } *regs += 1; }
40+
fn test9() { let regs = @mut 0; match true { true => { } _ => { } } *regs += 1; }
4041

4142
fn test10() -> int {
4243
let regs = @mut ~[0];
43-
match check true { true => { } }
44+
match true { true => { } _ => { } }
4445
(*regs)[0]
4546
}
4647

src/test/pretty/unary-op-disambig.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ fn if_semi() -> int { if true { f() } else { f() }; -1 }
1010

1111
fn if_nosemi() -> int { (if true { 0 } else { 0 }) - 1 }
1212

13-
fn alt_semi() -> int { match check true { true => { f() } }; -1 }
13+
fn alt_semi() -> int { match true { true => { f() } _ => { } }; -1 }
1414

15-
fn alt_no_semi() -> int { (match check true { true => { 0 } }) - 1 }
15+
fn alt_no_semi() -> int { (match true { true => { 0 } _ => { 1 } }) - 1 }
1616

1717
fn stmt() { { f() }; -1; }

src/test/run-fail/alt-wildcards.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// error-pattern:squirrelcupcake
22
fn cmp() -> int {
3-
match check (option::some('a'), option::none::<char>) {
3+
match (option::some('a'), option::none::<char>) {
44
(option::some(_), _) => { fail ~"squirrelcupcake"; }
55
(_, option::some(_)) => { fail; }
6+
_ => { fail ~"wat"; }
67
}
78
}
89

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ fn test_box() {
44
@0;
55
}
66
fn test_str() {
7-
let res = match check false { true => { ~"happy" } };
8-
assert res == ~"happy";
7+
let res = match false { true => { ~"happy" },
8+
_ => fail ~"non-exhaustive match failure" };
9+
assert res == ~"happy";
910
}
1011
fn main() {
1112
test_box();

src/test/run-pass/alt-bot-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// n.b. This was only ever failing with optimization disabled.
2-
fn a() -> int { match check return 1 { 2 => 3 } }
2+
fn a() -> int { match return 1 { 2 => 3, _ => fail } }
33
fn main() { a(); }

src/test/run-pass/alt-pattern-lit.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11

22

33
fn altlit(f: int) -> int {
4-
match check f {
4+
match f {
55
10 => { debug!("case 10"); return 20; }
66
11 => { debug!("case 11"); return 22; }
7+
_ => fail ~"the impossible happened"
78
}
89
}
910

src/test/run-pass/alt-range.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ fn main() {
77
6u..7u => fail ~"shouldn't match range",
88
_ => {}
99
}
10-
match check 5u {
10+
match 5u {
1111
1u => fail ~"should match non-first range",
1212
2u..6u => {}
13+
_ => fail ~"math is broken"
1314
}
1415
match 'c' {
1516
'a'..'z' => {}

src/test/run-pass/alt-str.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Issue #53
22

33
fn main() {
4-
match check ~"test" { ~"not-test" => fail, ~"test" => (), _ => fail }
4+
match ~"test" { ~"not-test" => fail, ~"test" => (), _ => fail }
55

66
enum t { tag1(~str), tag2, }
77

@@ -13,9 +13,9 @@ fn main() {
1313
_ => fail
1414
}
1515

16-
let x = match check ~"a" { ~"a" => 1, ~"b" => 2 };
16+
let x = match ~"a" { ~"a" => 1, ~"b" => 2, _ => fail };
1717
assert (x == 1);
1818
19-
match check ~"a" { ~"a" => { } ~"b" => { } }
19+
match ~"a" { ~"a" => { } ~"b" => { }, _ => fail }
2020

2121
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Check that issue #954 stays fixed
22

33
fn main() {
4-
match check -1 { -1 => {} }
4+
match -1 { -1 => {}, _ => fail ~"wat" }
55
assert 1-1 == 0;
66
}

src/test/run-pass/expr-alt-box.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55

66
// Tests for match as expressions resulting in boxed types
77
fn test_box() {
8-
let res = match check true { true => { @100 } };
8+
let res = match true { true => { @100 } _ => fail ~"wat" };
99
assert (*res == 100);
1010
}
1111

1212
fn test_str() {
13-
let res = match check true { true => { ~"happy" } };
13+
let res = match true { true => { ~"happy" },
14+
_ => fail ~"not happy at all" };
1415
assert (res == ~"happy");
1516
}
1617

src/test/run-pass/expr-alt-generic-box1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
type compare<T> = fn@(@T, @T) -> bool;
66

77
fn test_generic<T>(expected: @T, eq: compare<T>) {
8-
let actual: @T = match check true { true => { expected } };
8+
let actual: @T = match true { true => { expected }, _ => fail };
99
assert (eq(expected, actual));
1010
}
1111

src/test/run-pass/expr-alt-generic-box2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
type compare<T> = fn@(T, T) -> bool;
66

77
fn test_generic<T: copy>(expected: T, eq: compare<T>) {
8-
let actual: T = match check true { true => { expected } };
8+
let actual: T = match true { true => { expected }, _ => fail ~"wat" };
99
assert (eq(expected, actual));
1010
}
1111

src/test/run-pass/expr-alt-generic-unique1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
type compare<T> = fn@(~T, ~T) -> bool;
55

66
fn test_generic<T: copy>(expected: ~T, eq: compare<T>) {
7-
let actual: ~T = match check true { true => { expected } };
7+
let actual: ~T = match true { true => { expected }, _ => fail ~"wat" };
88
assert (eq(expected, actual));
99
}
1010

src/test/run-pass/expr-alt-generic-unique2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
type compare<T> = fn@(T, T) -> bool;
66

77
fn test_generic<T: copy>(expected: T, eq: compare<T>) {
8-
let actual: T = match check true { true => { expected } };
8+
let actual: T = match true { true => expected, _ => fail ~"wat" };
99
assert (eq(expected, actual));
1010
}
1111

src/test/run-pass/expr-alt-generic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
type compare<T> = fn@(T, T) -> bool;
66

77
fn test_generic<T: copy>(expected: T, eq: compare<T>) {
8-
let actual: T = match check true { true => { expected } };
8+
let actual: T = match true { true => { expected }, _ => fail ~"wat" };
99
assert (eq(expected, actual));
1010
}
1111

src/test/run-pass/expr-alt-struct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// Tests for match as expressions resulting in structural types
77
fn test_rec() {
8-
let rs = match check true { true => { {i: 100} } };
8+
let rs = match true { true => {i: 100}, _ => fail };
99
assert (rs == {i: 100});
1010
}
1111

src/test/run-pass/expr-alt-unique.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// Tests for match as expressions resulting in boxed types
77
fn test_box() {
8-
let res = match check true { true => { ~100 } };
8+
let res = match true { true => { ~100 }, _ => fail };
99
assert (*res == 100);
1010
}
1111

src/test/run-pass/weird-exprs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ fn canttouchthis() -> uint {
5959
fn angrydome() {
6060
loop { if break { } }
6161
let mut i = 0;
62-
loop { i += 1; if i == 1 { match check again { 1 => { } } } break; }
62+
loop { i += 1; if i == 1 { match again { 1 => { }, _ => fail ~"wat" } }
63+
break; }
6364
}
6465

6566
fn evil_lincoln() { let evil <- debug!("lincoln"); }

0 commit comments

Comments
 (0)