add eval test for let-binding with arithmetic expression
This commit is contained in:
parent
e4d6db7269
commit
c4537b947e
|
|
@ -144,4 +144,12 @@ mod tests {
|
||||||
let s = format_value(3.14);
|
let s = format_value(3.14);
|
||||||
assert!(s.starts_with("3.14"));
|
assert!(s.starts_with("3.14"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn eval_x_plus_5() {
|
||||||
|
let doc = "let x = 10\n/= x + 5";
|
||||||
|
let result = evaluate_document(doc);
|
||||||
|
assert_eq!(result.results.len(), 1);
|
||||||
|
assert_eq!(result.results[0].result, "15");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue