From b555033700bb45dfb0f387b15799979eaacf7a18 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 27 May 2010 18:45:25 +0200 Subject: [PATCH] extended test case --- tests/run/inlined_generator_expressions.pyx | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/run/inlined_generator_expressions.pyx b/tests/run/inlined_generator_expressions.pyx index 3fd1bbde..9bc9430c 100644 --- a/tests/run/inlined_generator_expressions.pyx +++ b/tests/run/inlined_generator_expressions.pyx @@ -125,3 +125,25 @@ def return_sum_squares_start(seq, int start): 333283335009 """ return sum((i*i for i in seq), start) + + +@cython.test_assert_path_exists( + '//ForInStatNode', + "//InlinedGeneratorExpressionNode") +@cython.test_fail_if_path_exists( + '//SimpleCallNode', + "//InlinedGeneratorExpressionNode//CoerceToPyTypeNode") +def return_typed_sum_squares_start(seq, int start): + """ + >>> sum([i*i for i in range(10)], -1) + 284 + >>> return_typed_sum_squares_start(range(10), -1) + 284 + + >>> sum([i*i for i in range(10000)], 9) + 333283335009 + >>> return_typed_sum_squares_start(range(10000), 9) + 333283335009 + """ + cdef int i + return sum((i*i for i in seq), start) -- 2.26.2