ganit-core 0.4.1

Spreadsheet formula engine — parser and evaluator for Excel-compatible formulas
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::evaluate;
use crate::types::Value;
use std::collections::HashMap;

fn run(formula: &str) -> Value {
    evaluate(formula, &HashMap::new())
}

#[test]
fn lambda_body_uses_conditional() {
    // LAMBDA with IF inside the body
    assert_eq!(run("=LAMBDA(x, IF(x>0, x, -x))(-5)"), Value::Number(5.0));
}