-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
Method with "return with multiline constant expr only" is not generating any coverage lines #946
Comments
Hi @Slamdunk, do you think this can be fixed? |
It definitively should |
here is minimalistic code to reproduce:
generates a coverage line, but
does not, notice same AST, for some reasons, no coverage is generated if the the string is concat across multiple lines the problem is xdebug generates coverage on a line where the last string is defined (l5 for first example, l6 for the 2nd), but executable line from static analysis is always on l5 I have looked into the source - https://github.com/sebastianbergmann/php-code-coverage/blob/main/src/StaticAnalysis/ExecutableLinesFindingVisitor.php - but I have not enough knowledge where executable lines should be generated. Help wanted with the fix. Also I propose to run the static analyser against some large project like Symfony (and maybe php-src tests) with random NL between AST tokens to verify the start line/end line rules are correctly used. |
I was able to reproduce this.
|
I'm going to look at this as soon as I can |
Once again: thank you so much, @Slamdunk! |
code:
https://github.com/atk4/data/blob/0c6bce5c2ac53589934b02bc0832a4753c283f15/src/Persistence/Sql/Oracle/PlatformTrait.php#L104-L109
is not generating any coverage line:
I would expect at least one coverage line for the
getListDatabasesSQL
method to be able to tell if called or notThe text was updated successfully, but these errors were encountered: