From cad68bb99e45da0f72c2855b10bc27cc6d12328a Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 29 Oct 2009 11:32:06 +0100 Subject: [PATCH] extended/fixed test case --- tests/run/int_float_builtins_as_casts_T400.pyx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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) -- 2.26.2