From: Robert Bradshaw Date: Sat, 21 Feb 2009 06:05:04 +0000 (-0800) Subject: Test for cmp nodes X-Git-Tag: 0.11.rc~72 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6943f537f2e93bfef0c0273cd5772bee29367ec2;p=cython.git Test for cmp nodes --- diff --git a/tests/run/cmp.pyx b/tests/run/cmp.pyx new file mode 100644 index 00000000..44cf6c67 --- /dev/null +++ b/tests/run/cmp.pyx @@ -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