extended/fixed test case
authorStefan Behnel <scoder@users.berlios.de>
Thu, 29 Oct 2009 10:32:06 +0000 (11:32 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Thu, 29 Oct 2009 10:32:06 +0000 (11:32 +0100)
tests/run/int_float_builtins_as_casts_T400.pyx

index 5284d3c45fc788473670199cd74bc97eddb45351..c0fc52eaca90644f33f3f5496eded41b5f1146bd 100644 (file)
@@ -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)