Remove unused enums and simplify test assertions

This commit is contained in:
timfish
2019-10-09 12:06:32 +01:00
parent 1999120298
commit 4217e96d19
23 changed files with 177 additions and 447 deletions

View File

@@ -5,17 +5,12 @@ fn test_not() {
let mut engine = Engine::new();
assert_eq!(
engine
.eval::<bool>("let not_true = !true; not_true")
.unwrap(),
false
engine.eval::<bool>("let not_true = !true; not_true"),
Ok(false)
);
assert_eq!(
engine.eval::<bool>("fn not(x) { !x } not(false)").unwrap(),
true
);
assert_eq!(engine.eval::<bool>("fn not(x) { !x } not(false)"), Ok(true));
// TODO - do we allow stacking unary operators directly? e.g '!!!!!!!true'
assert_eq!(engine.eval::<bool>("!(!(!(!(true))))").unwrap(), true)
assert_eq!(engine.eval::<bool>("!(!(!(!(true))))"), Ok(true));
}