From 131e416db40d1eb7b96c59a86c3d19eb3a6cd11d Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 16 May 2009 10:53:13 +0200 Subject: [PATCH] extended test case --- tests/run/enumerate_T316.pyx | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/run/enumerate_T316.pyx b/tests/run/enumerate_T316.pyx index 2ece7386..ed7ab34a 100644 --- a/tests/run/enumerate_T316.pyx +++ b/tests/run/enumerate_T316.pyx @@ -31,6 +31,28 @@ __doc__ = u""" 2 2 2 3 3 3 3 4 + >>> multi_c_enumerate() + 0 0 0 1 + 1 1 1 2 + 2 2 2 3 + 3 3 3 4 + + >>> py_enumerate_break(1,2,3,4) + 0 1 + :: 0 1 + + >>> py_enumerate_return() + :: 55 99 + >>> py_enumerate_return(1,2,3,4) + 0 1 + + >>> py_enumerate_continue(1,2,3,4) + 0 1 + 1 2 + 2 3 + 3 4 + :: 3 4 + """ def go_py_enumerate(): @@ -47,6 +69,27 @@ def go_c_enumerate_step(): for i,k in enumerate(range(1,7,2)): print i, k +def py_enumerate_break(*t): + i,k = 55,99 + for i,k in enumerate(t): + print i, k + break + print u"::", i, k + +def py_enumerate_return(*t): + i,k = 55,99 + for i,k in enumerate(t): + print i, k + return + print u"::", i, k + +def py_enumerate_continue(*t): + i,k = 55,99 + for i,k in enumerate(t): + print i, k + continue + print u"::", i, k + def empty_c_enumerate(): cdef int i = 55, k = 99 for i,k in enumerate(range(0)): -- 2.26.2