diff options
author | Nadrieril | 2020-01-29 18:17:12 +0000 |
---|---|---|
committer | Nadrieril | 2020-01-29 18:17:12 +0000 |
commit | f31ccaa40df77b1ca8b37db46a819460c831006e (patch) | |
tree | 296440e1a309aa164bdbdd2188efb8f047c95474 /dhall/src/tests.rs | |
parent | 7683b0d762cf0df489ad4bc006e8db2358e81cf4 (diff) |
Fix more bugs
Diffstat (limited to 'dhall/src/tests.rs')
-rw-r--r-- | dhall/src/tests.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/dhall/src/tests.rs b/dhall/src/tests.rs index 971c48d..1c687f6 100644 --- a/dhall/src/tests.rs +++ b/dhall/src/tests.rs @@ -193,13 +193,23 @@ pub fn run_test(test: Test<'_>) -> Result<()> { // assert_eq_pretty!(ty, expected); } TypeInferenceFailure(file_path) => { - let mut res = - parse_file_str(&file_path)?.skip_resolve()?.typecheck(); + // let mut res = + // parse_file_str(&file_path)?.skip_resolve()?.typecheck(); + // if let Ok(e) = &res { + // // If e did typecheck, check that get_type fails + // res = e.get_type(); + // } + // res.unwrap_err(); + + let res = crate::semantics::tck::typecheck::typecheck( + &parse_file_str(&file_path)?.skip_resolve()?.to_expr(), + ); if let Ok(e) = &res { // If e did typecheck, check that get_type fails - res = e.get_type(); + e.get_type().unwrap_err(); + } else { + res.unwrap_err(); } - res.unwrap_err(); } // Checks the output of the type error against a text file. If the text file doesn't exist, // we instead write to it the output we got. This makes it easy to update those files: just |