test case for #467
authorStefan Behnel <scoder@users.berlios.de>
Sun, 24 Jan 2010 15:47:16 +0000 (16:47 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Sun, 24 Jan 2010 15:47:16 +0000 (16:47 +0100)
tests/bugs.txt
tests/run/cascaded_list_unpacking_T467.pyx [new file with mode: 0644]

index 55e7e2c3df15948183cbb2335604ab9c3cdb361e..8a1b3fd76590958b20803c19ac6b302d7fdedb5c 100644 (file)
@@ -7,3 +7,4 @@ numpy_ValueError_T172
 unsignedbehaviour_T184
 missing_baseclass_in_predecl_T262
 cfunc_call_tuple_args_T408
+cascaded_list_unpacking_T467
diff --git a/tests/run/cascaded_list_unpacking_T467.pyx b/tests/run/cascaded_list_unpacking_T467.pyx
new file mode 100644 (file)
index 0000000..14f00e5
--- /dev/null
@@ -0,0 +1,32 @@
+
+def simple_parallel_assignment_from_call():
+    """
+    >>> simple_parallel_assignment_from_call()
+    (2, 1, 2, 1, 2, 1, 2, [1, 2], [1, 2])
+    """
+    cdef int ai, bi
+    cdef long al, bl
+    cdef object ao, bo
+    cdef int side_effect_count = call_count
+    ai, bi = al, bl = ao, bo = c = d = [intval(1), intval(2)]
+    side_effect_count = call_count - side_effect_count
+    return side_effect_count, ao, bo, ai, bi, al, bl, c, d
+
+def recursive_parallel_assignment_from_call():
+    """
+    >>> recursive_parallel_assignment_from_call()
+    (3, 1, 2, 3, 1, 2, 3, (1, 2), 3, [(1, 2), 3])
+    """
+    cdef int ai, bi, ci
+    cdef object ao, bo, co
+    cdef int side_effect_count = call_count
+    (ai, bi), ci = (ao, bo), co = t,o = d = [(intval(1), intval(2)), intval(3)]
+    side_effect_count = call_count - side_effect_count
+    return side_effect_count, ao, bo, co, ai, bi, ci, t, o, d
+
+cdef int call_count = 0
+
+cdef int intval(int x):
+    global call_count
+    call_count += 1
+    return x