From 889b8ae5285815133503794cf513092be274a830 Mon Sep 17 00:00:00 2001 From: Rushmore75 Date: Tue, 11 Nov 2025 15:36:31 -0700 Subject: [PATCH] add failing test --- src/app/calc.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/calc.rs b/src/app/calc.rs index dad6dc7..fb25187 100644 --- a/src/app/calc.rs +++ b/src/app/calc.rs @@ -51,7 +51,6 @@ impl Grid { } let ctx = ctx::CallbackContext::new(&self); - // let mut ctx = HashMapContext::::new(); match eval_with_context(eq, &ctx) { Ok(e) => { @@ -253,10 +252,21 @@ fn test_math() { let res = grid.evaluate(&a); assert!(res.is_some()); assert_eq!(res.unwrap(), 3.); - return; }, } } + + grid.set_cell("D0", "=50/60".to_string()); + let c = grid.get_cell("D0").as_ref().expect("I just set this"); + match c { + CellType::Number(_) => todo!(), + CellType::String(_) => todo!(), + CellType::Equation(e) => { + let res = grid.evaluate(e).expect("Should work"); + assert_eq!(res, 0.83); + return; + }, + } panic!("Should've found the value and returned"); }