Skip to content

Commit 9b48431

Browse files
committed
Bless coverage tests.
1 parent 8b20d0d commit 9b48431

File tree

6 files changed

+22
-29
lines changed

6 files changed

+22
-29
lines changed

tests/coverage/assert.coverage

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
LL| 4|fn might_fail_assert(one_plus_one: u32) {
55
LL| 4| println!("does 1 + 1 = {}?", one_plus_one);
66
LL| 4| assert_eq!(1 + 1, one_plus_one, "the argument was wrong");
7-
^1
87
LL| 3|}
98
LL| |
109
LL| 1|fn main() -> Result<(), u8> {

tests/coverage/bad_counter_ids.coverage

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
LL| 1|fn eq_good_message() {
2222
LL| 1| println!("b");
2323
LL| 1| assert_eq!(Foo(1), Foo(1), "message b");
24-
^0
2524
LL| 1|}
2625
LL| |
2726
LL| 1|fn ne_good() {
@@ -32,7 +31,6 @@
3231
LL| 1|fn ne_good_message() {
3332
LL| 1| println!("d");
3433
LL| 1| assert_ne!(Foo(1), Foo(3), "message d");
35-
^0
3634
LL| 1|}
3735
LL| |
3836
LL| 1|fn eq_bad() {

tests/coverage/closure.coverage

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
LL| |
1616
LL| 1| let mut some_string = Some(String::from("the string content"));
1717
LL| 1| println!(
18-
LL| 1| "The string or alt: {}"
18+
LL| | "The string or alt: {}"
1919
LL| | ,
2020
LL| 1| some_string
2121
LL| | .
@@ -45,7 +45,7 @@
4545
LL| 0| "alt string 2".to_owned()
4646
LL| 0| };
4747
LL| 1| println!(
48-
LL| 1| "The string or alt: {}"
48+
LL| | "The string or alt: {}"
4949
LL| | ,
5050
LL| 1| some_string
5151
LL| | .
@@ -57,7 +57,7 @@
5757
LL| |
5858
LL| 1| some_string = None;
5959
LL| 1| println!(
60-
LL| 1| "The string or alt: {}"
60+
LL| | "The string or alt: {}"
6161
LL| | ,
6262
LL| 1| some_string
6363
LL| | .
@@ -87,7 +87,7 @@
8787
LL| 1| "alt string 4".to_owned()
8888
LL| 1| };
8989
LL| 1| println!(
90-
LL| 1| "The string or alt: {}"
90+
LL| | "The string or alt: {}"
9191
LL| | ,
9292
LL| 1| some_string
9393
LL| | .
@@ -109,7 +109,7 @@
109109
LL| 5| format!("'{}'", val)
110110
LL| 5| };
111111
LL| 1| println!(
112-
LL| 1| "Repeated, quoted string: {:?}"
112+
LL| | "Repeated, quoted string: {:?}"
113113
LL| | ,
114114
LL| 1| std::iter::repeat("repeat me")
115115
LL| 1| .take(5)
@@ -139,15 +139,15 @@
139139
LL| |
140140
LL| 1| let short_used_covered_closure_macro = | used_arg: u8 | println!("called");
141141
LL| 1| let short_used_not_covered_closure_macro = | used_arg: u8 | println!("not called");
142-
^0 ^0
142+
^0
143143
LL| 1| let _short_unused_closure_macro = | _unused_arg: u8 | println!("not called");
144-
^0 ^0
144+
^0
145145
LL| |
146146
LL| |
147147
LL| |
148148
LL| |
149149
LL| 1| let _short_unused_closure_block = | _unused_arg: u8 | { println!("not called") };
150-
^0^0 ^0 ^0
150+
^0^0 ^0
151151
LL| |
152152
LL| 1| let _shortish_unused_closure = | _unused_arg: u8 | {
153153
^0
@@ -174,14 +174,14 @@
174174
LL| 1| let _short_unused_closure_line_break_no_block2 =
175175
LL| | | _unused_arg: u8 |
176176
LL| 0| println!(
177-
LL| 0| "not called"
177+
LL| | "not called"
178178
LL| | )
179179
LL| | ;
180180
LL| |
181181
LL| 1| let short_used_not_covered_closure_line_break_no_block_embedded_branch =
182182
LL| | | _unused_arg: u8 |
183183
LL| | println!(
184-
LL| 0| "not called: {}",
184+
LL| | "not called: {}",
185185
LL| 0| if is_true { "check" } else { "me" }
186186
LL| | )
187187
LL| | ;
@@ -190,7 +190,7 @@
190190
LL| | | _unused_arg: u8 |
191191
LL| 0| {
192192
LL| 0| println!(
193-
LL| 0| "not called: {}",
193+
LL| | "not called: {}",
194194
LL| 0| if is_true { "check" } else { "me" }
195195
LL| | )
196196
LL| 0| }
@@ -199,7 +199,7 @@
199199
LL| 1| let short_used_covered_closure_line_break_no_block_embedded_branch =
200200
LL| | | _unused_arg: u8 |
201201
LL| | println!(
202-
LL| 1| "not called: {}",
202+
LL| | "not called: {}",
203203
LL| 1| if is_true { "check" } else { "me" }
204204
^0
205205
LL| | )
@@ -209,7 +209,7 @@
209209
LL| | | _unused_arg: u8 |
210210
LL| 1| {
211211
LL| 1| println!(
212-
LL| 1| "not called: {}",
212+
LL| | "not called: {}",
213213
LL| 1| if is_true { "check" } else { "me" }
214214
^0
215215
LL| | )

tests/coverage/issue-84561.coverage

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,17 @@
2222
LL| 1| assert_ne!(bar, Foo(3));
2323
LL| 1| assert_ne!(Foo(0), Foo(4));
2424
LL| 1| assert_eq!(Foo(3), Foo(3), "with a message");
25-
^0
2625
LL| 1| println!("{:?}", bar);
2726
LL| 1| println!("{:?}", Foo(1));
2827
LL| |
2928
LL| 1| assert_ne!(Foo(0), Foo(5), "{}", if is_true { "true message" } else { "false message" });
30-
^0 ^0 ^0 ^0
29+
^0 ^0 ^0
3130
LL| 1| assert_ne!(
3231
LL| | Foo(0)
3332
LL| | ,
3433
LL| | Foo(5)
3534
LL| | ,
36-
LL| 0| "{}"
35+
LL| | "{}"
3736
LL| | ,
3837
LL| | if
3938
LL| 0| is_true
@@ -78,13 +77,13 @@
7877
LL| 1| assert_ne!(
7978
LL| | Foo(0),
8079
LL| | Foo(4),
81-
LL| 0| "with a message"
80+
LL| | "with a message"
8281
LL| | );
8382
LL| | } else {
8483
LL| 0| assert_eq!(
8584
LL| | Foo(3),
8685
LL| | Foo(3),
87-
LL| 0| "with a message"
86+
LL| | "with a message"
8887
LL| | );
8988
LL| | }
9089
LL| 1| assert_ne!(
@@ -122,17 +121,17 @@
122121
LL| 0| Foo(1)
123122
LL| | },
124123
LL| | Foo(5),
125-
LL| 0| "with a message"
124+
LL| | "with a message"
126125
LL| | );
127126
LL| 1| assert_eq!(
128127
LL| | Foo(1),
129128
LL| | Foo(3),
130-
LL| 1| "this assert should fail"
129+
LL| | "this assert should fail"
131130
LL| | );
132131
LL| 0| assert_eq!(
133132
LL| | Foo(3),
134133
LL| | Foo(3),
135-
LL| 0| "this assert should not be reached"
134+
LL| | "this assert should not be reached"
136135
LL| | );
137136
LL| 0|}
138137
LL| |
@@ -156,12 +155,9 @@
156155
LL| |
157156
LL| 1|fn test1() {
158157
LL| 1| debug!("debug is enabled");
159-
^0
160158
LL| 1| debug!("debug is enabled");
161-
^0
162159
LL| 1| let _ = 0;
163160
LL| 1| debug!("debug is enabled");
164-
^0
165161
LL| 1| unsafe {
166162
LL| 1| DEBUG_LEVEL_ENABLED = true;
167163
LL| 1| }

tests/coverage/partial_eq.coverage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
LL| 1| let version_3_3_0 = Version::new(3, 3, 0);
2020
LL| |
2121
LL| 1| println!(
22-
LL| 1| "{:?} < {:?} = {}",
22+
LL| | "{:?} < {:?} = {}",
2323
LL| | version_3_2_1,
2424
LL| | version_3_3_0,
2525
LL| 1| version_3_2_1 < version_3_3_0, //

tests/coverage/rustfmt-skip.coverage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
LL| 1| println!(
1313
LL| | // Keep this on a separate line, to distinguish instrumentation of
1414
LL| | // `println!` from instrumentation of its arguments.
15-
LL| 1| "hello"
15+
LL| | "hello"
1616
LL| | );
1717
LL| 1|}
1818

0 commit comments

Comments
 (0)