summaryrefslogtreecommitdiff
path: root/tests/run/builtincomplex.pyx
diff options
context:
space:
mode:
authorStefan Behnel <scoder@users.berlios.de>2010-12-04 10:46:51 +0100
committerStefan Behnel <scoder@users.berlios.de>2010-12-04 10:46:51 +0100
commit193388a369b5306693694ff60a1941d4de0e7168 (patch)
tree18f870a021dcec5d5980690a9751810f1de21b53 /tests/run/builtincomplex.pyx
parent0a2e5351617d49c333d5e4cc4f52deb1104b1a35 (diff)
downloadcython-193388a369b5306693694ff60a1941d4de0e7168.tar.gz
extended test case
Diffstat (limited to 'tests/run/builtincomplex.pyx')
-rw-r--r--tests/run/builtincomplex.pyx10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/run/builtincomplex.pyx b/tests/run/builtincomplex.pyx
index 603611753..90a24b487 100644
--- a/tests/run/builtincomplex.pyx
+++ b/tests/run/builtincomplex.pyx
@@ -27,3 +27,13 @@ def complex_cstruct_assign():
cval = &c.cval
cval.real, cval.imag = 10, 20
return (c.real, c.imag)
+
+def complex_coercion():
+ """
+ >>> complex_coercion()
+ (1.0, 2.0, 1.0, 2.0)
+ """
+ cdef complex py_c = 1+2j
+ cdef double complex c_c = py_c
+ cdef object py = c_c
+ return (c_c.real, c_c.imag, py.real, py.imag)