Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Same line" statements belonging to "else" bodies are not reported #38

Open
cgewecke opened this issue Jan 11, 2017 · 2 comments
Open

Comments

@cgewecke
Copy link
Collaborator

Istanbul reports a taken else branch as follows
ifelse

Solcover reports:
elsesol

The instrumentation looks like this:

Coverage('/Users/user/Sites/sol-coveralls/solcover/test.sol',5);
         StatementCoverage('/Users/user/Sites/sol-coveralls/solcover/test.sol',1);
if (x == 1) {BranchCoverage('/Users/user/Sites/sol-coveralls/solcover/test.sol',1,0);  StatementCoverage('/Users/user/Sites/sol-coveralls/solcover/test.sol',2);
x+= 1;}
        else {BranchCoverage('/Users/user/Sites/sol-coveralls/solcover/test.sol',1,1);  StatementCoverage('/Users/user/Sites/sol-coveralls/solcover/test.sol',3);
x += 5;}
    }

Same as #37.

@cgewecke
Copy link
Collaborator Author

@area I feel like this same-line else construction is relatively common and Istanbul's report is intuitively more informative. But as you note in #37 - the obvious fix would produce 11 hits. Also bound up with the else if analysis you made in the highlighting issue. . . . not sure what should be done here.

@area
Copy link
Member

area commented Jan 11, 2017

I agree that our output here definitely could be better. I'll have a fiddle!

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

No branches or pull requests

2 participants