summaryrefslogtreecommitdiff
path: root/test/test_arcs.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-10-16 07:57:08 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-10-16 07:57:08 -0400
commitc949c5f30a9003dbf02a87190119625397c5e04c (patch)
tree0bd41b43f54b5e51762b1e048c2c75895a3c0250 /test/test_arcs.py
parent84c9cc21909050a008ac2964ac387feaa2ad0f74 (diff)
downloadpython-coveragepy-git-c949c5f30a9003dbf02a87190119625397c5e04c.tar.gz
Ad-hoc discovery of opcodes that need to be parsed. BREAK_LOOP is implicit? yikes...
Diffstat (limited to 'test/test_arcs.py')
-rw-r--r--test/test_arcs.py29
1 files changed, 20 insertions, 9 deletions
diff --git a/test/test_arcs.py b/test/test_arcs.py
index 6c68e397..48e1b282 100644
--- a/test/test_arcs.py
+++ b/test/test_arcs.py
@@ -63,32 +63,43 @@ class ArcTest(CoverageTest):
if len([]) == 0:
a = 2
else:
- b = 4
- c = 5
+ a = 4
+ assert a == 2
""",
arcz=".1 12 25 14 45 5.", arcz_missing="14 45")
self.check_coverage("""\
if len([]) == 1:
a = 2
else:
- b = 4
- c = 5
+ a = 4
+ assert a == 4
""",
arcz=".1 12 25 14 45 5.", arcz_missing="12 25")
def test_loop(self):
self.check_coverage("""\
for i in range(10):
- a = 2
- b = 3
+ a = i
+ assert a == 9
""",
arcz=".1 12 21 13 3.", arcz_missing="")
self.check_coverage("""\
+ a = -1
for i in range(0):
- a = 2
- b = 3
+ a = i
+ assert a == -1
+ """,
+ arcz=".1 12 23 32 24 4.", arcz_missing="23 32")
+
+ def test_break(self):
+ self.check_coverage("""\
+ for i in range(10):
+ a = i
+ break # 3
+ a = 99
+ assert a == 0 # 5
""",
- arcz=".1 12 21 13 3.", arcz_missing="12 21")
+ arcz=".1 12 23 35 15 41 5.", arcz_missing="15 41")
def xest_xx(self):
self.check_coverage("""\