truecalc-core 3.2.0

Formula engine with exact Google Sheets semantics — stateless, embeddable evaluator
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::Engine;
use crate::types::{ErrorKind, Value};
use std::collections::HashMap;

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

#[test]
fn lambda_bare_returns_na() {
    // LAMBDA without invocation returns #N/A
    assert_eq!(run("=LAMBDA(x, x*2)"), Value::Error(ErrorKind::NA));
}