From: Stefan Behnel Date: Wed, 26 May 2010 21:03:14 +0000 (+0200) Subject: extended test case X-Git-Tag: 0.13.beta0~2^2~42 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a2e622137dd96fb3ea4c0f2da5d50e92509f4e2c;p=cython.git extended test case --- diff --git a/tests/run/inlined_generator_expressions.pyx b/tests/run/inlined_generator_expressions.pyx index 59df031e..4b6864c4 100644 --- a/tests/run/inlined_generator_expressions.pyx +++ b/tests/run/inlined_generator_expressions.pyx @@ -1,4 +1,10 @@ +cimport cython + +@cython.test_assert_path_exists('//ForFromStatNode', + "//InlinedGeneratorExpressionNode") +@cython.test_fail_if_path_exists('//SimpleCallNode', + '//ForInStatNode') def range_sum(int N): """ >>> sum(range(10)) @@ -9,6 +15,10 @@ def range_sum(int N): result = sum(i for i in range(N)) return result +@cython.test_assert_path_exists('//ForFromStatNode', + "//InlinedGeneratorExpressionNode") +@cython.test_fail_if_path_exists('//SimpleCallNode', + '//ForInStatNode') def return_range_sum(int N): """ >>> sum(range(10)) @@ -18,6 +28,10 @@ def return_range_sum(int N): """ return sum(i for i in range(N)) +@cython.test_assert_path_exists('//ForFromStatNode', + "//InlinedGeneratorExpressionNode") +@cython.test_fail_if_path_exists('//SimpleCallNode', + '//ForInStatNode') def return_range_sum_squares(int N): """ >>> sum([i*i for i in range(10)]) @@ -32,6 +46,9 @@ def return_range_sum_squares(int N): """ return sum(i*i for i in range(N)) +@cython.test_assert_path_exists('//ForInStatNode', + "//InlinedGeneratorExpressionNode") +@cython.test_fail_if_path_exists('//SimpleCallNode') def return_sum_squares(seq): """ >>> sum([i*i for i in range(10)]) @@ -46,6 +63,9 @@ def return_sum_squares(seq): """ return sum(i*i for i in seq) +@cython.test_assert_path_exists('//ForInStatNode', + "//InlinedGeneratorExpressionNode") +@cython.test_fail_if_path_exists('//SimpleCallNode') def return_sum_squares_start(seq, int start): """ >>> sum([i*i for i in range(10)], -1)