From: Stefan Behnel Date: Thu, 29 Oct 2009 10:32:06 +0000 (+0100) Subject: extended/fixed test case X-Git-Tag: 0.12.alpha0~8^2~17 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cad68bb99e45da0f72c2855b10bc27cc6d12328a;p=cython.git extended/fixed test case --- diff --git a/tests/run/int_float_builtins_as_casts_T400.pyx b/tests/run/int_float_builtins_as_casts_T400.pyx index 5284d3c4..c0fc52ea 100644 --- a/tests/run/int_float_builtins_as_casts_T400.pyx +++ b/tests/run/int_float_builtins_as_casts_T400.pyx @@ -25,13 +25,25 @@ def double_to_pyssizet_int(double x): cdef Py_ssize_t r = int(x) return r +@cython.test_assert_path_exists("//SingleAssignmentNode/CastNode") +@cython.test_fail_if_path_exists("//SimpleCallNode") +def int_to_pyssizet_int(int x): + """ + >>> int_to_pyssizet_int(4.1) + 4 + >>> int_to_pyssizet_int(4) + 4 + """ + cdef Py_ssize_t r = int(x) + return r + @cython.test_assert_path_exists("//SingleAssignmentNode/CastNode") @cython.test_fail_if_path_exists("//SimpleCallNode") def double_to_pyssizet_float(double x): """ - >>> double_to_pyssizet_int(4.1) + >>> double_to_pyssizet_float(4.1) 4 - >>> double_to_pyssizet_int(4) + >>> double_to_pyssizet_float(4) 4 """ cdef Py_ssize_t r = float(x)