Closed DanTup closed 6 years ago
Or should I only look at the tokens in that small range of code (eg. the union of the token numbers in
hits
andmisses
when picking the "next token"?
Thinking about this more, I think this makes sense if only a subset of the tokens are "executable". I should be running up to the next "executable" token. I'll give it a shot and update back here with more testing...
Seems to work great; unexecuted lines now seem to match what I'd expect (whitespace/comment lines are already excluded by me).
So closing this - I think I may have another issue, but I'll dig further and open a more case with specifics if I think I need help.
@a-siva @devoncarew
I'm trying to map coverage tokens back to code ranges using the "next token" position as discussed yesterday. I tried this, but it seems like there are "holes" in the coverage data interpreting it this way.
Consider this file (this is from the Stocks example in the Flutter repo, reformatted with dartfmt before I started testing):
Here's how it looks in my IDE with line numbers (note: the grey
// StockRow
and// ListView.builder
towards the end of IDE decorations and not part of the code):When I look at the coverage data and try to map it back to lines as discussed, here's what I get:
The numbers generally look good (line 11 is the constructor, line 21 starts the build method) but for some reason there's no coverage for line 23 or 24, but looking at the Code I would've expected it).
Here's the coverage report:
Am I doing this correctly? Or should I only look at the tokens in that small range of code (eg. the union of the token numbers in
hits
andmisses
when picking the "next token"?