From 2996bded2f8e7fcd218bc123895287a4df7f2ab7 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 8 Mar 2009 13:42:46 +0100 Subject: [PATCH] extended test case to also cover ticket #6 --- tests/run/specialfloat.pyx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/run/specialfloat.pyx b/tests/run/specialfloat.pyx index dfbe04bb..af96fa2a 100644 --- a/tests/run/specialfloat.pyx +++ b/tests/run/specialfloat.pyx @@ -44,6 +44,11 @@ __doc__ = u""" -inf >>> float_infn == float('-inf') True + + >>> global_floats()[1:] == (float('+inf'), float('-inf')) + True + >>> global_floats()[0] + nan """ DEF FLOAT = 12.5 @@ -51,6 +56,10 @@ DEF FLOAT_NAN = float('nan') DEF FLOAT_INFP = float('+inf') DEF FLOAT_INFN = float('-inf') +cdef double cdef_float_nan = float('nan') +cdef double cdef_float_infp = float('+inf') +cdef double cdef_float_infn = float('-inf') + float_nan = FLOAT_NAN float_infp = FLOAT_INFP float_infn = FLOAT_INFN @@ -105,3 +114,5 @@ def infn3(): f = FLOAT_INFN return f +def global_floats(): + return (cdef_float_nan, cdef_float_infp, cdef_float_infn) -- 2.26.2