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

@@ -4,12 +4,11 @@ use rhai::Engine;
fn test_while() {
let mut engine = Engine::new();
if let Ok(result) = engine.eval::<i64>(
"let x = 0; while x < 10 { x = x + 1; if x > 5 { \
break } } x",
) {
assert_eq!(result, 6);
} else {
assert!(false);
}
assert_eq!(
engine.eval::<i64>(
"let x = 0; while x < 10 { x = x + 1; if x > 5 { \
break } } x",
),
Ok(6)
);
}