Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coverage: Regression test for assert!(!false) #119011

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tests/coverage/assert_not.cov-map
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Function name: assert_not::main
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]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Counter(1), rhs = Zero
- expression 1 operands: lhs = Counter(3), rhs = Zero
Number of file 0 mappings: 5
- Code(Counter(0)) at (prev + 6, 1) to (start + 1, 18)
- Code(Counter(1)) at (prev + 2, 5) to (start + 0, 20)
- Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 20)
= (c1 - Zero)
- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 22)
- Code(Expression(1, Sub)) at (prev + 1, 1) to (start + 0, 2)
= (c3 - Zero)

12 changes: 12 additions & 0 deletions tests/coverage/assert_not.coverage
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
LL| |// edition: 2021
LL| |
LL| |// Regression test for <https://github.com/rust-lang/rust/issues/118904>.
LL| |// `assert!(true)` and `assert!(!false)` should have similar coverage spans.
LL| |
LL| 1|fn main() {
LL| 1| assert!(true);
LL| 1| assert!(!false);
LL| 1| assert!(!!true);
LL| 1| assert!(!!!false);
LL| 1|}

11 changes: 11 additions & 0 deletions tests/coverage/assert_not.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// edition: 2021

// Regression test for <https://github.com/rust-lang/rust/issues/118904>.
// `assert!(true)` and `assert!(!false)` should have similar coverage spans.

fn main() {
assert!(true);
assert!(!false);
assert!(!!true);
assert!(!!!false);
}
Loading