-
Notifications
You must be signed in to change notification settings - Fork 985
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
Add errors on separate lines for coverage #4301
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4301 +/- ##
========================================
Coverage 99.61% 99.61%
========================================
Files 72 72
Lines 13916 14088 +172
========================================
+ Hits 13862 14034 +172
Misses 54 54 ☔ View full report in Codecov by Sentry. |
wow! 62% (176/285) of these branches were uncovered. looks like it's paying off already in terms of understanding spurious coverage. |
@@ -6312,15 +6312,13 @@ options(datatable.optimize = Inf) | |||
|
|||
# fread dec=',' e.g. France | |||
test(1439, fread("A;B\n1;2,34\n", dec="12"), error="nchar(dec) == 1L is not TRUE") | |||
test(1440, fread("A;B\n8;2,34\n", dec="1"), data.table(A=8L, B="2,34")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!dec %chin% c('.', ',')
is implied incorrect by L1179 of fread.c
@ master:
dec='' not allowed. Should be '.' or ','
?fread
is not as strict:
The decimal separator as in utils::read.csv. If not "." (default) then usually ",". See details.
Took a conservative approach for now, and blocked !dec %chin% c(',', '.')
. But that broke two tests (1440
and 1444.2
here).
dec='1'
and dec='*'
ran without errors... happy to restore this to work, and change the error/message found in fread.c
.
@@ -1328,7 +1348,8 @@ SEXP binary(SEXP x) | |||
{ | |||
char buffer[69]; | |||
int j; | |||
if (!isReal(x)) error(_("x must be type 'double'")); | |||
if (!isReal(x)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function binary(
isn't used anywhere... just for debugging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
Don't know how to cover this line so leaving this PR here:
|
Heads up that there will be a ton of conflicts between this one and #4306 (I count 20 at the moment). Let's merge this one first, since this one adds a bunch of internal errors. |
@jangorecki any thoughts on the third point -- should we put verbose messaging on its own line as well? |
@MichaelChirico I don't think it is so important. I would just keep that in mind when coding new stuff, but not necessarily touch all the existing one. |
What would it take to make C coverage cover branches within one line; i.e. like R coverage already does? |
…me-line-branch codecov #4301 (comment)
Too many conflicts here. This is being handled incrementally for now. If needed, when the PR queue is emptier, we can start this from scratch & add a linter to prevent backsliding. |
Is not caught by Codecov because it doesn't build a proper AST for C code. So we have to put
error
branches on their own line to be properly detected by Codecov.Only done this for
error
so far. A few more patterns could be included:warning
STOP
infread.c
Rprintf
etc, not sure how important it is to cover these... I see about 100 more lines withDTPRINT
andRprintf