From db7fbdf35ed40a006886ad6f462ec174899569b6 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 18 Nov 2012 07:16:45 +0100 Subject: [PATCH] add test for temp type adaptation from C array to C pointer type --HG-- extra : transplant_source : %08%F6%88rE%C7%F5%CD.%9Ad%244m%0Cw%8C%25g%C0 --- tests/run/cascaded_typed_assignments_T466.pyx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/run/cascaded_typed_assignments_T466.pyx b/tests/run/cascaded_typed_assignments_T466.pyx index 0e34c12..5ae0d85 100644 --- a/tests/run/cascaded_typed_assignments_T466.pyx +++ b/tests/run/cascaded_typed_assignments_T466.pyx @@ -2,6 +2,8 @@ # ticket: 466 # extension to T409 +cimport cython + def simple_parallel_typed(): """ >>> simple_parallel_typed() @@ -67,3 +69,23 @@ def non_simple_rhs_malloc(): # check copied values assert x[0] == c'X' assert x[1] == c'\0' + +@cython.test_assert_path_exists( + '//CascadedAssignmentNode', + '//CascadedAssignmentNode//CoerceToTempNode', + '//CascadedAssignmentNode//CoerceToTempNode[@type.is_ptr]') +def assign_carray(): + """ + assign_carray() + (1, 2, 3) + """ + cdef int *b, *c + cdef int[3] a + a[0] = 1 + a[1] = 2 + a[2] = 3 + + b = c = a+1 + assert b[0] == 2 + assert c[1] == 3 + return a[0], b[0], c[1] -- 2.7.4