From a60e97c2223dae901ecd70bc9c13eb30942efd31 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 21 Apr 2008 08:02:45 +0200 Subject: [PATCH] test case for DEF int constant assignment --- tests/run/ct_DEF.pyx | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/tests/run/ct_DEF.pyx b/tests/run/ct_DEF.pyx index bf191a11..d85cfb06 100644 --- a/tests/run/ct_DEF.pyx +++ b/tests/run/ct_DEF.pyx @@ -1,8 +1,12 @@ __doc__ = """ >>> c() 120 - >>> i() - 42 + >>> i1() == 42 + True + >>> i2() == 0x42 + True + >>> i3() == 042 + True >>> l() 666 >>> f() @@ -23,7 +27,9 @@ DEF TUPLE = (1, 2, "buckle my shoe") DEF TRUE_FALSE = (True, False) DEF CHAR = c'x' -DEF INT = 42 +DEF INT1 = 42 +DEF INT2 = 0x42 +DEF INT3 = 042 DEF LONG = 666L DEF FLOAT = 12.5 DEF STR = "spam" @@ -37,9 +43,19 @@ def c(): c = CHAR return c -def i(): +def i1(): + cdef int i + i = INT1 + return i + +def i2(): + cdef int i + i = INT2 + return i + +def i3(): cdef int i - i = INT + i = INT3 return i def l(): -- 2.26.2