From e3da02e7bcfd85c543419e7590a3c86f64d8cc8a Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Fri, 12 Jun 2009 16:13:52 -0700 Subject: add less_than_int, greater_than_int to edify Add functions less_than_int() and greater_than_int() that interpret their args as ints and do the comparison. ("<" and ">" operators, if implemented, should do string comparison.) This lets us do the build time check currently done by the check_prereq binary. --- edify/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'edify/main.c') diff --git a/edify/main.c b/edify/main.c index 03eefc69e..0e3610847 100644 --- a/edify/main.c +++ b/edify/main.c @@ -143,6 +143,16 @@ int test() { expect("if \"\" then yes endif", "", &errors); expect("if \"\"; t then yes endif", "yes", &errors); + // numeric comparisons + expect("less_than_int(3, 14)", "t", &errors); + expect("less_than_int(14, 3)", "", &errors); + expect("less_than_int(x, 3)", "", &errors); + expect("less_than_int(3, x)", "", &errors); + expect("greater_than_int(3, 14)", "", &errors); + expect("greater_than_int(14, 3)", "t", &errors); + expect("greater_than_int(x, 3)", "", &errors); + expect("greater_than_int(3, x)", "", &errors); + printf("\n"); return errors; -- cgit v1.2.3