Skip to content

Commit 9022e6a

Browse files
committed
Auto merge of #119011 - Zalathar:assert-not, r=est31
coverage: Regression test for `assert!(!false)` This verifies that #118904 has already been fixed by #118198. --- `@rustbot` label +A-code-coverage
2 parents 4451777 + bc77717 commit 9022e6a

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

tests/coverage/assert_not.cov-map

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Function name: assert_not::main
2+
Raw bytes (33): 0x[01, 01, 02, 05, 00, 0d, 00, 05, 01, 06, 01, 01, 12, 05, 02, 05, 00, 14, 02, 01, 05, 00, 14, 0d, 01, 05, 00, 16, 06, 01, 01, 00, 02]
3+
Number of files: 1
4+
- file 0 => global file 1
5+
Number of expressions: 2
6+
- expression 0 operands: lhs = Counter(1), rhs = Zero
7+
- expression 1 operands: lhs = Counter(3), rhs = Zero
8+
Number of file 0 mappings: 5
9+
- Code(Counter(0)) at (prev + 6, 1) to (start + 1, 18)
10+
- Code(Counter(1)) at (prev + 2, 5) to (start + 0, 20)
11+
- Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 20)
12+
= (c1 - Zero)
13+
- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 22)
14+
- Code(Expression(1, Sub)) at (prev + 1, 1) to (start + 0, 2)
15+
= (c3 - Zero)
16+

tests/coverage/assert_not.coverage

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
LL| |// edition: 2021
2+
LL| |
3+
LL| |// Regression test for <https://github.com/rust-lang/rust/issues/118904>.
4+
LL| |// `assert!(true)` and `assert!(!false)` should have similar coverage spans.
5+
LL| |
6+
LL| 1|fn main() {
7+
LL| 1| assert!(true);
8+
LL| 1| assert!(!false);
9+
LL| 1| assert!(!!true);
10+
LL| 1| assert!(!!!false);
11+
LL| 1|}
12+

tests/coverage/assert_not.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// edition: 2021
2+
3+
// Regression test for <https://github.com/rust-lang/rust/issues/118904>.
4+
// `assert!(true)` and `assert!(!false)` should have similar coverage spans.
5+
6+
fn main() {
7+
assert!(true);
8+
assert!(!false);
9+
assert!(!!true);
10+
assert!(!!!false);
11+
}

0 commit comments

Comments
 (0)