summaryrefslogtreecommitdiff
path: root/dhall/src/tests.rs
diff options
context:
space:
mode:
authorNadrieril2019-05-05 00:10:58 +0200
committerNadrieril2019-05-05 00:10:58 +0200
commite8560d0dcb6c8051e2059f369258ec4bf07879f3 (patch)
tree46bda9b32e4c0c67a91190ce67f5beb85e71456d /dhall/src/tests.rs
parent0e6bc247d254a60eb1ba234e538864f0e9604efe (diff)
Implement alpha-normalization
Closes #12
Diffstat (limited to '')
-rw-r--r--dhall/src/tests.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/dhall/src/tests.rs b/dhall/src/tests.rs
index ce74606..6b2ab60 100644
--- a/dhall/src/tests.rs
+++ b/dhall/src/tests.rs
@@ -43,6 +43,7 @@ pub enum Feature {
Parser,
Import,
Normalization,
+ AlphaNormalization,
Typecheck,
TypeInference,
}
@@ -83,6 +84,7 @@ pub fn run_test(
Parser => "parser/",
Import => "import/",
Normalization => "normalization/",
+ AlphaNormalization => "alpha-normalization/",
Typecheck => "typecheck/",
TypeInference => "type-inference/",
};
@@ -139,6 +141,11 @@ pub fn run_test(
let expr = expr.skip_typecheck().normalize();
assert_eq_display!(expr, expected);
}
+ AlphaNormalization => {
+ let expr =
+ expr.skip_typecheck().normalize().to_expr_alpha();
+ assert_eq_display!(expr, expected.to_expr());
+ }
}
}
Failure => {
@@ -154,7 +161,7 @@ pub fn run_test(
Import => {
parse_file_str(&file_path)?.resolve().unwrap_err();
}
- Normalization => unreachable!(),
+ Normalization | AlphaNormalization => unreachable!(),
Typecheck | TypeInference => {
parse_file_str(&file_path)?
.skip_resolve()?