-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.code coverageArea → source tooling: code coverageArea → source tooling: code coveragecompilerThe Swift compiler itselfThe Swift compiler itselfcontrol transfer statementsFeature → statements: control transfer statementsFeature → statements: control transfer statementssource toolingArea: IDE support, SourceKit, and other source toolingArea: IDE support, SourceKit, and other source toolingstatementsFeature: statementsFeature: statementsswift 5.9throwFeature → error handling: Throw statementsFeature → error handling: Throw statementsunexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output
Description
Description
With code coverage, lines that aren’t executed after a throw still have their hit count incremented.
Steps to reproduce
- Open the sample project
- Run testExample() unit test
- Notice in Throws.swift that the commented line shows 3 hits instead of 1
Expected behavior
The commented line should show 1 hit
Environment
-
Swift compiler version info: swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
Target: arm64-apple-macosx13.0 -
Xcode version info: Version 14.2 (14C18)
-
Deployment target: macOS 13.1
Also reported as: FB7656633
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.code coverageArea → source tooling: code coverageArea → source tooling: code coveragecompilerThe Swift compiler itselfThe Swift compiler itselfcontrol transfer statementsFeature → statements: control transfer statementsFeature → statements: control transfer statementssource toolingArea: IDE support, SourceKit, and other source toolingArea: IDE support, SourceKit, and other source toolingstatementsFeature: statementsFeature: statementsswift 5.9throwFeature → error handling: Throw statementsFeature → error handling: Throw statementsunexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output