truecalc-core 1.0.2

Spreadsheet formula engine — parser and evaluator for Excel-compatible formulas
Documentation
use super::super::not_fn;
use crate::types::{ErrorKind, Value};

#[test]
fn not_zero_returns_true() {
    assert_eq!(not_fn(&[Value::Number(0.0)]), Value::Bool(true));
}

#[test]
fn no_args_returns_value_error() {
    assert_eq!(not_fn(&[]), Value::Error(ErrorKind::NA));
}

#[test]
fn array_broadcasts_element_wise() {
    // GS: NOT broadcasts over arrays element-wise
    assert_eq!(
        not_fn(&[Value::Array(vec![Value::Bool(true), Value::Bool(false)])]),
        Value::Array(vec![Value::Bool(false), Value::Bool(true)])
    );
}