From 6943f537f2e93bfef0c0273cd5772bee29367ec2 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Fri, 20 Feb 2009 22:05:04 -0800 Subject: [PATCH] Test for cmp nodes --- tests/run/cmp.pyx | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/run/cmp.pyx 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 -- 2.26.2