Skip to content

Commit 95bb0d8

Browse files
committed
misc: make test cases much less verbose
1 parent bdc64d3 commit 95bb0d8

File tree

3 files changed

+111
-221
lines changed

3 files changed

+111
-221
lines changed

tests/ui/bool_comparison.fixed

Lines changed: 29 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -4,91 +4,36 @@
44

55
fn main() {
66
let x = true;
7-
if x {
8-
//~^ bool_comparison
9-
"yes"
10-
} else {
11-
"no"
12-
};
13-
if !x {
14-
//~^ bool_comparison
15-
"yes"
16-
} else {
17-
"no"
18-
};
19-
if x {
20-
//~^ bool_comparison
21-
"yes"
22-
} else {
23-
"no"
24-
};
25-
if !x {
26-
//~^ bool_comparison
27-
"yes"
28-
} else {
29-
"no"
30-
};
31-
if !x {
32-
//~^ bool_comparison
33-
"yes"
34-
} else {
35-
"no"
36-
};
37-
if x {
38-
//~^ bool_comparison
39-
"yes"
40-
} else {
41-
"no"
42-
};
43-
if !x {
44-
//~^ bool_comparison
45-
"yes"
46-
} else {
47-
"no"
48-
};
49-
if x {
50-
//~^ bool_comparison
51-
"yes"
52-
} else {
53-
"no"
54-
};
55-
if !x {
56-
//~^ bool_comparison
57-
"yes"
58-
} else {
59-
"no"
60-
};
61-
if x {
62-
//~^ bool_comparison
63-
"yes"
64-
} else {
65-
"no"
66-
};
67-
if x {
68-
//~^ bool_comparison
69-
"yes"
70-
} else {
71-
"no"
72-
};
73-
if !x {
74-
//~^ bool_comparison
75-
"yes"
76-
} else {
77-
"no"
78-
};
7+
let _ = if x { "yes" } else { "no" };
8+
//~^ bool_comparison
9+
let _ = if !x { "yes" } else { "no" };
10+
//~^ bool_comparison
11+
let _ = if x { "yes" } else { "no" };
12+
//~^ bool_comparison
13+
let _ = if !x { "yes" } else { "no" };
14+
//~^ bool_comparison
15+
let _ = if !x { "yes" } else { "no" };
16+
//~^ bool_comparison
17+
let _ = if x { "yes" } else { "no" };
18+
//~^ bool_comparison
19+
let _ = if !x { "yes" } else { "no" };
20+
//~^ bool_comparison
21+
let _ = if x { "yes" } else { "no" };
22+
//~^ bool_comparison
23+
let _ = if !x { "yes" } else { "no" };
24+
//~^ bool_comparison
25+
let _ = if x { "yes" } else { "no" };
26+
//~^ bool_comparison
27+
let _ = if x { "yes" } else { "no" };
28+
//~^ bool_comparison
29+
let _ = if !x { "yes" } else { "no" };
30+
//~^ bool_comparison
31+
7932
let y = true;
80-
if !x & y {
81-
//~^ bool_comparison
82-
"yes"
83-
} else {
84-
"no"
85-
};
86-
if x & !y {
87-
//~^ bool_comparison
88-
"yes"
89-
} else {
90-
"no"
91-
};
33+
let _ = if !x & y { "yes" } else { "no" };
34+
//~^ bool_comparison
35+
let _ = if x & !y { "yes" } else { "no" };
36+
//~^ bool_comparison
9237
}
9338

9439
#[allow(dead_code)]

tests/ui/bool_comparison.rs

Lines changed: 29 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -4,91 +4,36 @@
44

55
fn main() {
66
let x = true;
7-
if x == true {
8-
//~^ bool_comparison
9-
"yes"
10-
} else {
11-
"no"
12-
};
13-
if x == false {
14-
//~^ bool_comparison
15-
"yes"
16-
} else {
17-
"no"
18-
};
19-
if true == x {
20-
//~^ bool_comparison
21-
"yes"
22-
} else {
23-
"no"
24-
};
25-
if false == x {
26-
//~^ bool_comparison
27-
"yes"
28-
} else {
29-
"no"
30-
};
31-
if x != true {
32-
//~^ bool_comparison
33-
"yes"
34-
} else {
35-
"no"
36-
};
37-
if x != false {
38-
//~^ bool_comparison
39-
"yes"
40-
} else {
41-
"no"
42-
};
43-
if true != x {
44-
//~^ bool_comparison
45-
"yes"
46-
} else {
47-
"no"
48-
};
49-
if false != x {
50-
//~^ bool_comparison
51-
"yes"
52-
} else {
53-
"no"
54-
};
55-
if x < true {
56-
//~^ bool_comparison
57-
"yes"
58-
} else {
59-
"no"
60-
};
61-
if false < x {
62-
//~^ bool_comparison
63-
"yes"
64-
} else {
65-
"no"
66-
};
67-
if x > false {
68-
//~^ bool_comparison
69-
"yes"
70-
} else {
71-
"no"
72-
};
73-
if true > x {
74-
//~^ bool_comparison
75-
"yes"
76-
} else {
77-
"no"
78-
};
7+
let _ = if x == true { "yes" } else { "no" };
8+
//~^ bool_comparison
9+
let _ = if x == false { "yes" } else { "no" };
10+
//~^ bool_comparison
11+
let _ = if true == x { "yes" } else { "no" };
12+
//~^ bool_comparison
13+
let _ = if false == x { "yes" } else { "no" };
14+
//~^ bool_comparison
15+
let _ = if x != true { "yes" } else { "no" };
16+
//~^ bool_comparison
17+
let _ = if x != false { "yes" } else { "no" };
18+
//~^ bool_comparison
19+
let _ = if true != x { "yes" } else { "no" };
20+
//~^ bool_comparison
21+
let _ = if false != x { "yes" } else { "no" };
22+
//~^ bool_comparison
23+
let _ = if x < true { "yes" } else { "no" };
24+
//~^ bool_comparison
25+
let _ = if false < x { "yes" } else { "no" };
26+
//~^ bool_comparison
27+
let _ = if x > false { "yes" } else { "no" };
28+
//~^ bool_comparison
29+
let _ = if true > x { "yes" } else { "no" };
30+
//~^ bool_comparison
31+
7932
let y = true;
80-
if x < y {
81-
//~^ bool_comparison
82-
"yes"
83-
} else {
84-
"no"
85-
};
86-
if x > y {
87-
//~^ bool_comparison
88-
"yes"
89-
} else {
90-
"no"
91-
};
33+
let _ = if x < y { "yes" } else { "no" };
34+
//~^ bool_comparison
35+
let _ = if x > y { "yes" } else { "no" };
36+
//~^ bool_comparison
9237
}
9338

9439
#[allow(dead_code)]

0 commit comments

Comments
 (0)