(self)
| 391 | # is done by manual inspection of the output |
| 392 | |
| 393 | def test_for_iter_list(self): |
| 394 | def testfunc(a): |
| 395 | total = 0 |
| 396 | for i in a: |
| 397 | total += i |
| 398 | return total |
| 399 | |
| 400 | a = list(range(TIER2_THRESHOLD)) |
| 401 | total = testfunc(a) |
| 402 | self.assertEqual(total, sum(a)) |
| 403 | |
| 404 | ex = get_first_executor(testfunc) |
| 405 | self.assertIsNotNone(ex) |
| 406 | # for i, (opname, oparg) in enumerate(ex): |
| 407 | # print(f"{i:4d}: {opname:<20s} {oparg:3d}") |
| 408 | uops = get_opnames(ex) |
| 409 | self.assertIn("_GUARD_NOT_EXHAUSTED_LIST", uops) |
| 410 | # Verification that the jump goes past END_FOR |
| 411 | # is done by manual inspection of the output |
| 412 | |
| 413 | def test_for_iter_tuple(self): |
| 414 | def testfunc(a): |
nothing calls this directly
no test coverage detected