summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-10-23 09:24:27 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-10-23 09:24:27 -0400
commit654c6a41d246e4826d7c77ffa15419454e521dc4 (patch)
tree45bd4a854e56648d1bcf30fc1ea46db3e5e4ebdf /coverage/control.py
parent595bf4786b276ea4c88d52f21d47c6d68769482e (diff)
downloadpython-coveragepy-654c6a41d246e4826d7c77ffa15419454e521dc4.tar.gz
Properly shift multiline references to the first line of the statement. This code is sloppy, I just want it to work first.
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/coverage/control.py b/coverage/control.py
index da773d3..76e17f6 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -354,17 +354,8 @@ class Analysis:
# Identify missing statements.
self.missing = []
self.executed = self.coverage.data.executed_lines(self.filename)
- for line in self.statements:
- lines = line_map.get(line)
- if lines:
- for l in range(lines[0], lines[1]+1):
- if l in self.executed:
- break
- else:
- self.missing.append(line)
- else:
- if line not in self.executed:
- self.missing.append(line)
+ exec1 = self.parser._map_to_first_lines(self.executed)
+ self.missing = sorted(set(self.statements) - set(exec1))
def missing_formatted(self):
return format_lines(self.statements, self.missing)
@@ -373,7 +364,10 @@ class Analysis:
return self.parser.arc_info()
def arcs_executed(self):
- return self.coverage.data.executed_arcs(self.filename)
+ executed = self.coverage.data.executed_arcs(self.filename)
+ m2fl = self.parser._map_to_first_line
+ executed = [(m2fl(l1), m2fl(l2)) for (l1,l2) in executed]
+ return executed
def arcs_missing(self):
possible = self.arc_possibilities()