about summary refs log tree commit diff
path: root/tests/coverage/async.coverage
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2025-04-12 17:52:55 +1000
committerZalathar <Zalathar@users.noreply.github.com>2025-05-06 20:42:25 +1000
commit4d5a1acebfe031ca2af75786295a2cd2a0633943 (patch)
treea0b54774a87c3b03b526566969c395a0dd4add2c /tests/coverage/async.coverage
parent651e9cf327358b28db7e37a2ae61727f4a2ef232 (diff)
downloadrust-4d5a1acebfe031ca2af75786295a2cd2a0633943.tar.gz
rust-4d5a1acebfe031ca2af75786295a2cd2a0633943.zip
coverage: Only merge adjacent coverage spans
This also removes some manipulation of the function signature span that only
made sense in the context of merging non-adjacent spans.
Diffstat (limited to 'tests/coverage/async.coverage')
-rw-r--r--tests/coverage/async.coverage14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/coverage/async.coverage b/tests/coverage/async.coverage
index aee76b05fb7..9fca1b6997d 100644
--- a/tests/coverage/async.coverage
+++ b/tests/coverage/async.coverage
@@ -25,6 +25,7 @@
    LL|      0|async fn foo() -> [bool; 10] { [false; 10] } // unused function; executor does not block on `h()`
    LL|       |
    LL|      1|pub async fn g(x: u8) {
+                                    ^0
    LL|      0|    match x {
    LL|      0|        y if e().await == y => (),
    LL|      0|        y if f().await == y => (),
@@ -33,8 +34,9 @@
    LL|      0|}
    LL|       |
    LL|      1|async fn h(x: usize) { // The function signature is counted when called, but the body is not
-   LL|      0|                       // executed (not awaited) so the open brace has a `0` count (at least when
-   LL|      0|                       // displayed with `llvm-cov show` in color-mode).
+                                   ^0
+   LL|       |                       // executed (not awaited) so the open brace has a `0` count (at least when
+   LL|       |                       // displayed with `llvm-cov show` in color-mode).
    LL|      0|    match x {
    LL|      0|        y if foo().await[y] => (),
    LL|      0|        _ => (),
@@ -42,9 +44,9 @@
    LL|      0|}
    LL|       |
    LL|      1|async fn i(x: u8) { // line coverage is 1, but there are 2 regions:
-   LL|      1|                    // (a) the function signature, counted when the function is called; and
-   LL|      1|                    // (b) the open brace for the function body, counted once when the body is
-   LL|      1|                    // executed asynchronously.
+   LL|       |                    // (a) the function signature, counted when the function is called; and
+   LL|       |                    // (b) the open brace for the function body, counted once when the body is
+   LL|       |                    // executed asynchronously.
    LL|      1|    match x {
    LL|      1|        y if c(x).await == y + 1 => { d().await; }
                       ^0                            ^0
@@ -91,7 +93,7 @@
    LL|      1|}
    LL|       |
    LL|      1|async fn m(x: u8) -> u8 { x - 1 }
-                                      ^0
+                                      ^0^0    ^0
    LL|       |
    LL|      1|fn main() {
    LL|      1|    let _ = g(10);