Skip to content

fix: Add tests for analyzing if statements without else clauses#4

Merged
keyskey merged 1 commit into
mainfrom
fix-implicit-if-branch-count
Apr 27, 2026
Merged

fix: Add tests for analyzing if statements without else clauses#4
keyskey merged 1 commit into
mainfrom
fix-implicit-if-branch-count

Conversation

@keyskey
Copy link
Copy Markdown
Owner

@keyskey keyskey commented Apr 27, 2026

Introduce new test cases in analyzer_test.go to evaluate the behavior of the Analyze function when handling if statements that lack else clauses.
The tests cover scenarios with terminating bodies, non-terminating bodies, and panic conditions. Additionally, update branch candidate collection logic in branches.go to correctly identify implicit false paths based on the structure of the if body.

Enhancements include the addition of helper functions for checking if a body terminates and for determining if fallthrough conditions are met, improving the accuracy of branch coverage analysis.

Introduce new test cases in analyzer_test.go to evaluate the behavior of the Analyze function when handling if statements that lack else clauses.
The tests cover scenarios with terminating bodies, non-terminating bodies, and panic conditions. Additionally, update branch candidate collection logic in branches.go to correctly identify implicit false paths based on the structure of the if body.

Enhancements include the addition of helper functions for checking if a body terminates and for determining if fallthrough conditions are met, improving the accuracy of branch coverage analysis.
@keyskey keyskey self-assigned this Apr 27, 2026
@keyskey keyskey added bug Something isn't working enhancement New feature or request labels Apr 27, 2026
@keyskey keyskey merged commit 9e1b134 into main Apr 27, 2026
1 check passed
@keyskey keyskey deleted the fix-implicit-if-branch-count branch April 27, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant