From 4bf38df09c6a39ec9d33b3fc578c901227150c64 Mon Sep 17 00:00:00 2001 From: sterni Date: Mon, 19 Sep 2022 10:59:00 +0200 Subject: [PATCH] fix(tvix/eval): fix flipped sign in builtins.compareVersions Change-Id: I42fc0dc633fbd525eaa35689a41ec3717f4352a2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6690 Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/builtins/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index 10ec6c89f..a5ca2114e 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -109,9 +109,9 @@ fn pure_builtins() -> Vec { let s2 = VersionPartsIter::new(s2.as_str()); match s1.cmp(s2) { - std::cmp::Ordering::Less => Ok(Value::Integer(1)), + std::cmp::Ordering::Less => Ok(Value::Integer(-1)), std::cmp::Ordering::Equal => Ok(Value::Integer(0)), - std::cmp::Ordering::Greater => Ok(Value::Integer(-1)), + std::cmp::Ordering::Greater => Ok(Value::Integer(1)), } }), Builtin::new("div", &[true, true], |mut args, _| {