Fix divide support

This commit is contained in:
jonathandturner
2016-03-03 11:32:02 -05:00
parent 1d12141f0b
commit b5075e6511
3 changed files with 10 additions and 2 deletions

View File

@@ -695,7 +695,7 @@ fn test_number_literal() {
}
#[test]
fn test_addition() {
fn test_ops() {
let mut engine = Engine::new();
if let Ok(result) = engine.eval("60 + 5".to_string()).unwrap().downcast::<i32>() {
@@ -704,6 +704,13 @@ fn test_addition() {
else {
assert!(false);
}
if let Ok(result) = engine.eval("(1 + 2) * (6 - 4) / 2".to_string()).unwrap().downcast::<i32>() {
assert_eq!(*result, 3);
}
else {
assert!(false);
}
}
#[test]