Test signed SUBTRACT result from unsigned literals

This commit is contained in:
Paul Masurel
2026-08-18 17:45:34 +02:00
parent b309f8f82c
commit 6b697c5c3e
+10
View File
@@ -238,4 +238,14 @@ mod tests {
// SAFETY: The expression has no inputs and returns an absent value.
assert_eq!(unsafe { compiled.call(&[]).as_i64() }, None);
}
#[test]
fn test_compile_time_i64() {
let expression = deserialize("(SUBTRACT 1u64 10u64)").unwrap();
let mut compiled = compile(&expression, &HashMap::new()).unwrap();
assert_eq!(compiled.result_type(), VarType::I64);
// SAFETY: The expression has no inputs and returns an absent value.
assert_eq!(unsafe { compiled.call(&[]).as_i64() }, Some(-9i64));
}
}