From e8e96dfcb3f5218ad33c0331720cd02790879227 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 24 Dec 2012 11:22:51 +0100 Subject: [PATCH] add test case for argument evaluation order in inlined DefNode calls --- tests/run/closure_inlining.pyx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/run/closure_inlining.pyx b/tests/run/closure_inlining.pyx index bf28980..5786949 100644 --- a/tests/run/closure_inlining.pyx +++ b/tests/run/closure_inlining.pyx @@ -85,3 +85,24 @@ def test_global_calls_still_work(): return 123 global_call_result = test_global_calls_still_work() + + +@cython.test_fail_if_path_exists( + '//InlinedDefNodeCallNode//SimpleCallNode') +@cython.test_assert_path_exists( + '//InlinedDefNodeCallNode', + '//InlinedDefNodeCallNode[@function_name.name = "call"]', + '//InlinedDefNodeCallNode//InlinedDefNodeCallNode') +def test_sideeffect_call_order(): + """ + >>> test_sideeffect_call_order() + [2, 4, 5] + """ + L = [] + def sideeffect(x): + L.append(x) + return x + def call(x1, x2, x3, x4, x5): + pass + call(1, sideeffect(2), 3, sideeffect(4), sideeffect(5)) + return L -- 2.7.4