From 396ec334bac1e8d10a2d2b2d683c93e3b2ff4d8d Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 6 Apr 2019 20:04:04 +0200 Subject: Massage import loading into new API Closes #9 --- dhall/tests/common/mod.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'dhall/tests/common') diff --git a/dhall/tests/common/mod.rs b/dhall/tests/common/mod.rs index e748cf0..70b7d81 100644 --- a/dhall/tests/common/mod.rs +++ b/dhall/tests/common/mod.rs @@ -54,6 +54,12 @@ pub fn read_dhall_file_no_resolve_imports<'i>( load_dhall_file_no_resolve_imports(&PathBuf::from(file_path)) } +pub fn load_from_file_str<'i>( + file_path: &str, +) -> Result { + load_from_file(&PathBuf::from(file_path)) +} + pub fn run_test(base_path: &str, feature: Feature) { use self::Feature::*; let base_path_prefix = match feature { @@ -90,8 +96,7 @@ pub fn run_test(base_path: &str, feature: Feature) { } ParserFailure => { let file_path = base_path + ".dhall"; - let err = - read_dhall_file_no_resolve_imports(&file_path).unwrap_err(); + let err = load_from_file_str(&file_path).unwrap_err(); match err { ImportError::ParseError(_) => {} e => panic!("Expected parse error, got: {:?}", e), -- cgit v1.2.3