Test for cmp nodes
authorRobert Bradshaw <robertwb@math.washington.edu>
Sat, 21 Feb 2009 06:05:04 +0000 (22:05 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sat, 21 Feb 2009 06:05:04 +0000 (22:05 -0800)
tests/run/cmp.pyx [new file with mode: 0644]

diff --git a/tests/run/cmp.pyx b/tests/run/cmp.pyx
new file mode 100644 (file)
index 0000000..44cf6c6
--- /dev/null
@@ -0,0 +1,35 @@
+__doc__ = """
+    >>> single_py(1, 2)
+    True
+    >>> single_py(2, 1)
+    False
+    >>> cascaded_py(1, 2, 3)
+    True
+    >>> cascaded_py(1, 2, -1)
+    False
+    >>> cascaded_py(10, 2, 3)
+    False
+
+    >>> single_c(1, 2)
+    True
+    >>> single_c(2, 1)
+    False
+    >>> cascaded_c(1, 2, 3)
+    True
+    >>> cascaded_c(1, 2, -1)
+    False
+    >>> cascaded_c(10, 2, 3)
+    False
+"""
+
+def single_py(a, b):
+    return a < b
+
+def cascaded_py(a, b, c):
+    return a < b < c
+
+def single_c(int a, int b):
+    return a < b
+
+def cascaded_c(double a, double b, double c):
+    return a < b < c