tests for '**' operator
authorStefan Behnel <scoder@users.berlios.de>
Wed, 2 Jan 2008 11:52:32 +0000 (12:52 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 2 Jan 2008 11:52:32 +0000 (12:52 +0100)
tests/broken/powop.pyx [deleted file]
tests/run/powop.pyx [new file with mode: 0644]

diff --git a/tests/broken/powop.pyx b/tests/broken/powop.pyx
deleted file mode 100644 (file)
index 2a08358..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-def f(obj1, obj2, obj3):
-    cdef float flt1, flt2, flt3
-    flt1 = flt2 ** flt3
-    obj1 = obj2 ** obj3
diff --git a/tests/run/powop.pyx b/tests/run/powop.pyx
new file mode 100644 (file)
index 0000000..c8633ea
--- /dev/null
@@ -0,0 +1,26 @@
+__doc__ = """
+    >>> f(1.0, 2.95)[0] == f(1.0, 2.95)[1]
+    True
+
+    >>> constant_py()
+    1024L
+
+    >>> constant_long() == 2L ** 36
+    True
+"""
+
+def f(obj2, obj3):
+    cdef float flt1, flt2, flt3
+    flt2, flt3 = obj2, obj3
+
+    flt1 = flt2 ** flt3
+    obj1 = obj2 ** obj3
+    return flt1, obj1
+
+def constant_py():
+    result = 2L ** 10
+    return result
+
+def constant_long():
+    result = 2L ** 36
+    return result