aboutsummaryrefslogtreecommitdiff
path: root/tests/test_execution.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_execution.rs')
-rw-r--r--tests/test_execution.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_execution.rs b/tests/test_execution.rs
index dd1b038..5aeac19 100644
--- a/tests/test_execution.rs
+++ b/tests/test_execution.rs
@@ -4,18 +4,18 @@ use chrysanthemum::util::*;
#[test]
fn test_simple() {
- assert_eq!(execute(Context::new(), Const(0, Type::Boolean)), Ok(Term(0, Type::Boolean)));
- assert_eq!(execute(Context::new(), Const(123, Type::Natural)), Ok(Term(123, Type::Natural)));
- assert_eq!(execute(Context::new(), Const(123, Type::Integer)), Ok(Term(123, Type::Integer)));
+ assert_eq!(execute(Context::new(), Const(0)), Ok(Term(0, Empty)));
+ assert_eq!(execute(Context::new(), Const(123)), Ok(Term(123, Empty)));
+ assert_eq!(execute(Context::new(), Const(123)), Ok(Term(123, Empty)));
assert!(execute(Context::new(), Var("x")).is_err());
}
#[test]
fn test_complex() {
let mut context = Context::new();
- context.insert(String::from("x"), Term(413, Type::Natural));
- context.insert(String::from("y"), Term(1, Type::Boolean));
- assert_eq!(execute(context.clone(), Var("x")), Ok(Term(413, Type::Natural)));
- assert_eq!(execute(context.clone(), Cond(Var("y"), Const(612, Type::Integer), Var("x"))), Ok(Term(612, Type::Integer)));
- assert_eq!(execute(context.clone(), App(Abs("z", Cond(Const(0, Type::Boolean), Var("x"), Var("z"))), Const(1025, Type::Integer))), Ok(Term(1025, Type::Integer)));
+ context.insert(String::from("x"), Term(413, Empty));
+ context.insert(String::from("y"), Term(1, Empty));
+ assert_eq!(execute(context.clone(), Var("x")), Ok(Term(413, Empty)));
+ assert_eq!(execute(context.clone(), Cond(Var("y"), Const(612), Var("x"))), Ok(Term(612, Empty)));
+ assert_eq!(execute(context.clone(), App(Abs("z", Cond(Const(0), Var("x"), Var("z"))), Const(1025))), Ok(Term(1025, Empty)));
}