summaryrefslogtreecommitdiff
path: root/dhall/src/tests.rs
diff options
context:
space:
mode:
authorNadrieril Feneanar2019-08-26 21:24:30 +0200
committerGitHub2019-08-26 21:24:30 +0200
commit959c13bc68980fe8bc884e3eb46e5e79272a4eba (patch)
tree33d4cab88763d86fe3dbce2c9d7d76de3f05932d /dhall/src/tests.rs
parent2f6ae31f4682266e647d25f7554a66d543bec7ac (diff)
parent2df5c09242375ca29b7e95ac76de427c4f1518ed (diff)
Merge pull request #106 from Nadrieril/dont-compile-twice
Tweak tests to avoid double compilation
Diffstat (limited to '')
-rw-r--r--dhall/src/tests.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/dhall/src/tests.rs b/dhall/src/tests.rs
index 8f16a12..074818a 100644
--- a/dhall/src/tests.rs
+++ b/dhall/src/tests.rs
@@ -1,3 +1,6 @@
+#[cfg(not(test))]
+use assert_eq as assert_eq_pretty;
+#[cfg(test)]
use pretty_assertions::assert_eq as assert_eq_pretty;
macro_rules! assert_eq_display {
@@ -40,6 +43,7 @@ use std::path::PathBuf;
use crate::error::{Error, Result};
use crate::phase::Parsed;
+#[allow(dead_code)]
#[derive(Copy, Clone)]
pub enum Feature {
Parser,
@@ -53,6 +57,7 @@ pub enum Feature {
TypeInference,
}
+#[allow(dead_code)]
#[derive(Copy, Clone)]
pub enum Status {
Success,
@@ -63,6 +68,7 @@ fn parse_file_str<'i>(file_path: &str) -> Result<Parsed> {
Parsed::parse_file(&PathBuf::from(file_path))
}
+#[allow(dead_code)]
pub fn run_test_stringy_error(
base_path: &str,
feature: Feature,
@@ -241,6 +247,7 @@ pub fn run_test(
Ok(())
}
+#[cfg(test)]
mod spec {
// See build.rs
include!(concat!(env!("OUT_DIR"), "/spec_tests.rs"));