aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorMaximilian Bosch <[email protected]>2021-12-26 14:41:47 +0000
committerMaximilian Bosch <[email protected]>2021-12-30 17:06:50 +0000
commit18a1ce8f0343f7865f8a01741fb96f98945645d0 (patch)
treecf3631b94197305b61fd0279025d4fb32d51abea /src/main.rs
parent7d1db014ebc6bf0a8fd3e5a25abdc81aa2270a1d (diff)
Allow expressions such as `e2` as multiplication of `e * 2`
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 75c33bb..f5e5c59 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -259,4 +259,9 @@ mod tests {
259 let evaled = eval_math_expression("9 + _ ", Some(0f64)).unwrap(); 259 let evaled = eval_math_expression("9 + _ ", Some(0f64)).unwrap();
260 assert_eq!(9., evaled); 260 assert_eq!(9., evaled);
261 } 261 }
262 #[test]
263 fn eval_const_multiplication() {
264 let evaled = eval_math_expression("e2", None).unwrap();
265 assert_eq!(5.4365636569, evaled);
266 }
262} 267}