Skip to content

Conversation

jrglee
Copy link
Contributor

@jrglee jrglee commented Aug 3, 2022

The readme mentions that branch coverage includes if/else, pattern matching, partial functions and try/catch/finally. But currently, it only supports if/else and try/catch/finally. All the case statements are not covered as branches. This means pattern matching, partial functions, catch blocks and any ad-hoc match statement that functionally acts as an if/else block.

This change follows what was done in the early versions of the repo and instruments the case statements as branches. Since case statements are also used as sentinels, it is necessary to parameterize the transformCases helper to distinguish when to actually instrument with branching or not.

This addresses #96 which has been open for quite a while already.

Copy link
Member

@ckipp01 ckipp01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the pr @jrglee. Looks good, LGTM

@ckipp01 ckipp01 merged commit a6dc5c0 into scoverage:main Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants