Closed
Description
I tried running the LLVM code coverage report against this code using cargo llvm-cov
:
async fn my_async_fn() -> bool {
another_async_fn()
.await
}
async fn another_async_fn() -> bool {
true
}
#[cfg(test)]
mod tests {
use crate::my_async_fn;
#[tokio::test]
async fn function_returns_true() {
assert!(my_async_fn().await);
}
}
I expected this to result in 100% code coverage.
Instead, the .await
on line 3 is considered not covered:
Meta
rustc 1.61.0 (fe5b13d68 2022-05-18)
binary: rustc
commit-hash: fe5b13d681f25ee6474be29d748c65adcd91f69e
commit-date: 2022-05-18
host: aarch64-apple-darwin
release: 1.61.0
LLVM version: 14.0.0