Skip to content

test: Add regression test for fallthrough behavior in if statements#5

Merged
keyskey merged 2 commits into
mainfrom
fix-fallthrough-covered-logic
Apr 27, 2026
Merged

test: Add regression test for fallthrough behavior in if statements#5
keyskey merged 2 commits into
mainfrom
fix-fallthrough-covered-logic

Conversation

@keyskey

@keyskey keyskey commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Introduce a new test case in analyzer_test.go to verify that the Analyze function correctly handles fallthrough scenarios when the next statement starts on a new line after an if-body block. This addresses a specific regression related to coverage analysis of implicit false paths. Additionally, update the fallthroughCovered function in branches.go to improve the logic for determining coverage based on the nearest block after the body. This enhances the accuracy of branch coverage reporting.

keyskey added 2 commits April 27, 2026 18:56
Introduce a new test case in analyzer_test.go to validate the handling of fallthrough scenarios in if statements without else clauses. The test ensures that the coverage analysis correctly identifies implicit false paths when the next statement starts on a new line. Additionally, update the fallthroughCovered function in branches.go to improve the logic for determining coverage based on the nearest block after the if body.
@keyskey keyskey self-assigned this Apr 27, 2026
@keyskey keyskey added the enhancement New feature or request label Apr 27, 2026
@keyskey keyskey merged commit 61d5c62 into main Apr 27, 2026
1 check passed
@keyskey keyskey deleted the fix-fallthrough-covered-logic branch April 27, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant