aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
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 2a2cf9d..bc22ce2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -227,6 +227,11 @@ mod tests {
227 assert_eq!(32., evaled); 227 assert_eq!(32., evaled);
228 } 228 }
229 #[test] 229 #[test]
230 fn exponentiation() {
231 let evaled = eval_math_expression("2 ** 2 ** 3", None).unwrap();
232 assert_eq!(256., evaled); // 2^(2^3), not (2^2)^3
233 }
234 #[test]
230 fn floating_ops() { 235 fn floating_ops() {
231 let evaled = eval_math_expression("1.2816 + 1 + 1.2816/1.2", Some(0f64)).unwrap(); 236 let evaled = eval_math_expression("1.2816 + 1 + 1.2816/1.2", Some(0f64)).unwrap();
232 assert_eq!(3.3496, evaled); 237 assert_eq!(3.3496, evaled);