summaryrefslogtreecommitdiff
path: root/dhall
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dhall/src/tests.rs8
-rw-r--r--dhall/tests/import/success/unit/asLocation/Canonicalize1B.dhall2
-rw-r--r--dhall/tests/import/success/unit/asLocation/Canonicalize2B.dhall2
-rw-r--r--dhall/tests/import/success/unit/asLocation/Canonicalize3B.dhall2
-rw-r--r--dhall/tests/import/success/unit/asLocation/Canonicalize4B.dhall2
-rw-r--r--dhall/tests/import/success/unit/asLocation/Canonicalize5B.dhall2
-rw-r--r--dhall/tests/import/success/unit/asLocation/Chain1B.dhall2
-rw-r--r--dhall/tests/import/success/unit/asLocation/Chain2B.dhall2
-rw-r--r--dhall/tests/import/success/unit/asLocation/Chain3B.dhall2
-rw-r--r--dhall/tests/import/success/unit/asLocation/HashB.dhall2
-rw-r--r--dhall/tests/import/success/unit/asLocation/RelativeB.dhall2
11 files changed, 17 insertions, 11 deletions
diff --git a/dhall/src/tests.rs b/dhall/src/tests.rs
index 482f9ae..3649f8d 100644
--- a/dhall/src/tests.rs
+++ b/dhall/src/tests.rs
@@ -80,7 +80,7 @@ impl TestFile {
match self {
TestFile::Source(path)
| TestFile::Binary(path)
- | TestFile::UI(path) => PathBuf::from(path),
+ | TestFile::UI(path) => PathBuf::from("dhall").join(path),
}
}
@@ -243,6 +243,11 @@ fn run_test_stringy_error(test: Test) -> std::result::Result<(), String> {
fn run_test(test: Test) -> Result<()> {
use self::Test::*;
+ // Setup current directory to the root of the repository. Important for import tests.
+ env::set_current_dir(
+ PathBuf::from(env!("CARGO_MANIFEST_DIR")).parent().unwrap(),
+ )?;
+
match test {
ParserSuccess(expr, expected) => {
let expr = expr.parse()?;
@@ -302,6 +307,7 @@ fn run_test(test: Test) -> Result<()> {
expected.compare(expr)?;
}
}
+
Ok(())
}
diff --git a/dhall/tests/import/success/unit/asLocation/Canonicalize1B.dhall b/dhall/tests/import/success/unit/asLocation/Canonicalize1B.dhall
index b7d9f3d..3a8a926 100644
--- a/dhall/tests/import/success/unit/asLocation/Canonicalize1B.dhall
+++ b/dhall/tests/import/success/unit/asLocation/Canonicalize1B.dhall
@@ -1,2 +1,2 @@
< Environment : Text | Remote : Text | Local : Text | Missing >.Local
- "./tests/import/success/unit/asLocation/foo/bar/import.dhall"
+ "./dhall/tests/import/success/unit/asLocation/foo/bar/import.dhall"
diff --git a/dhall/tests/import/success/unit/asLocation/Canonicalize2B.dhall b/dhall/tests/import/success/unit/asLocation/Canonicalize2B.dhall
index b7d9f3d..3a8a926 100644
--- a/dhall/tests/import/success/unit/asLocation/Canonicalize2B.dhall
+++ b/dhall/tests/import/success/unit/asLocation/Canonicalize2B.dhall
@@ -1,2 +1,2 @@
< Environment : Text | Remote : Text | Local : Text | Missing >.Local
- "./tests/import/success/unit/asLocation/foo/bar/import.dhall"
+ "./dhall/tests/import/success/unit/asLocation/foo/bar/import.dhall"
diff --git a/dhall/tests/import/success/unit/asLocation/Canonicalize3B.dhall b/dhall/tests/import/success/unit/asLocation/Canonicalize3B.dhall
index d54f065..b223da6 100644
--- a/dhall/tests/import/success/unit/asLocation/Canonicalize3B.dhall
+++ b/dhall/tests/import/success/unit/asLocation/Canonicalize3B.dhall
@@ -1,2 +1,2 @@
< Environment : Text | Remote : Text | Local : Text | Missing >.Local
- "./tests/import/success/unit/bar/import.dhall"
+ "./dhall/tests/import/success/unit/bar/import.dhall"
diff --git a/dhall/tests/import/success/unit/asLocation/Canonicalize4B.dhall b/dhall/tests/import/success/unit/asLocation/Canonicalize4B.dhall
index 7dd93f7..b6301f8 100644
--- a/dhall/tests/import/success/unit/asLocation/Canonicalize4B.dhall
+++ b/dhall/tests/import/success/unit/asLocation/Canonicalize4B.dhall
@@ -1,2 +1,2 @@
< Environment : Text | Remote : Text | Local : Text | Missing >.Local
- "./tests/import/success/bar/import.dhall"
+ "./dhall/tests/import/success/bar/import.dhall"
diff --git a/dhall/tests/import/success/unit/asLocation/Canonicalize5B.dhall b/dhall/tests/import/success/unit/asLocation/Canonicalize5B.dhall
index d54f065..b223da6 100644
--- a/dhall/tests/import/success/unit/asLocation/Canonicalize5B.dhall
+++ b/dhall/tests/import/success/unit/asLocation/Canonicalize5B.dhall
@@ -1,2 +1,2 @@
< Environment : Text | Remote : Text | Local : Text | Missing >.Local
- "./tests/import/success/unit/bar/import.dhall"
+ "./dhall/tests/import/success/unit/bar/import.dhall"
diff --git a/dhall/tests/import/success/unit/asLocation/Chain1B.dhall b/dhall/tests/import/success/unit/asLocation/Chain1B.dhall
index 3055c8e..6aee0b5 100644
--- a/dhall/tests/import/success/unit/asLocation/Chain1B.dhall
+++ b/dhall/tests/import/success/unit/asLocation/Chain1B.dhall
@@ -1,2 +1,2 @@
< Environment : Text | Local : Text | Missing | Remote : Text >.Local
- "./tests/import/success/unit/asLocation/some/import.dhall"
+ "./dhall/tests/import/success/unit/asLocation/some/import.dhall"
diff --git a/dhall/tests/import/success/unit/asLocation/Chain2B.dhall b/dhall/tests/import/success/unit/asLocation/Chain2B.dhall
index 20df611..6aba54e 100644
--- a/dhall/tests/import/success/unit/asLocation/Chain2B.dhall
+++ b/dhall/tests/import/success/unit/asLocation/Chain2B.dhall
@@ -1,2 +1,2 @@
< Environment : Text | Local : Text | Missing | Remote : Text >.Local
- "./tests/import/success/bar/import.dhall"
+ "./dhall/tests/import/success/bar/import.dhall"
diff --git a/dhall/tests/import/success/unit/asLocation/Chain3B.dhall b/dhall/tests/import/success/unit/asLocation/Chain3B.dhall
index 20df611..6aba54e 100644
--- a/dhall/tests/import/success/unit/asLocation/Chain3B.dhall
+++ b/dhall/tests/import/success/unit/asLocation/Chain3B.dhall
@@ -1,2 +1,2 @@
< Environment : Text | Local : Text | Missing | Remote : Text >.Local
- "./tests/import/success/bar/import.dhall"
+ "./dhall/tests/import/success/bar/import.dhall"
diff --git a/dhall/tests/import/success/unit/asLocation/HashB.dhall b/dhall/tests/import/success/unit/asLocation/HashB.dhall
index 3055c8e..6aee0b5 100644
--- a/dhall/tests/import/success/unit/asLocation/HashB.dhall
+++ b/dhall/tests/import/success/unit/asLocation/HashB.dhall
@@ -1,2 +1,2 @@
< Environment : Text | Local : Text | Missing | Remote : Text >.Local
- "./tests/import/success/unit/asLocation/some/import.dhall"
+ "./dhall/tests/import/success/unit/asLocation/some/import.dhall"
diff --git a/dhall/tests/import/success/unit/asLocation/RelativeB.dhall b/dhall/tests/import/success/unit/asLocation/RelativeB.dhall
index 1ef12f2..b3bd255 100644
--- a/dhall/tests/import/success/unit/asLocation/RelativeB.dhall
+++ b/dhall/tests/import/success/unit/asLocation/RelativeB.dhall
@@ -1,2 +1,2 @@
< Environment : Text | Remote : Text | Local : Text | Missing >.Local
- "./tests/import/success/unit/asLocation/some/import.dhall"
+ "./dhall/tests/import/success/unit/asLocation/some/import.dhall"