X-Git-Url: http://git.annexia.org/?p=whenjobs.git;a=blobdiff_plain;f=lib%2Fwhenutils.ml;h=aa59f1851fd92eed894304c2e001a90db5242a67;hp=e43dcf61ea2f4dbf1d2fe2708f10b1a2d42fafe8;hb=9ad0053f1eea3636134a9744f40a3585204b1d7e;hpb=df2cdcfdc29af0080b9b3eace17325d2a1d83e72 diff --git a/lib/whenutils.ml b/lib/whenutils.ml index e43dcf6..aa59f18 100644 --- a/lib/whenutils.ml +++ b/lib/whenutils.ml @@ -480,14 +480,14 @@ let rec eval_whenexpr job variables onload = function | Expr_increases v -> let prev_value, curr_value = get_prev_curr_value job variables v in - if compare_values prev_value curr_value > 0 then + if compare_values prev_value curr_value < 0 then T_bool true else T_bool false | Expr_decreases v -> let prev_value, curr_value = get_prev_curr_value job variables v in - if compare_values prev_value curr_value < 0 then + if compare_values prev_value curr_value > 0 then T_bool true else T_bool false @@ -533,6 +533,7 @@ and compare_values value1 value2 = | T_string s1, T_string s2 -> compare s1 s2 | T_int i1, T_int i2 -> compare_big_int i1 i2 | T_float f1, T_float f2 -> compare f1 f2 + (* XXX BUG: int should be promoted to float in mixed numeric comparison *) | _ -> let value1 = string_of_variable value1 and value2 = string_of_variable value2 in