From 980349dff0aaaa6ed34ae78d53ff57b67d7629d5 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 6 Dec 2020 17:18:58 +0000 Subject: Add test --- dhall/tests/import/success/unit/MixImportModesA.dhall | 1 + dhall/tests/import/success/unit/MixImportModesB.dhall | 1 + dhall/tests/spec.rs | 2 ++ 3 files changed, 4 insertions(+) create mode 100644 dhall/tests/import/success/unit/MixImportModesA.dhall create mode 100644 dhall/tests/import/success/unit/MixImportModesB.dhall (limited to 'dhall/tests') diff --git a/dhall/tests/import/success/unit/MixImportModesA.dhall b/dhall/tests/import/success/unit/MixImportModesA.dhall new file mode 100644 index 0000000..8946ff8 --- /dev/null +++ b/dhall/tests/import/success/unit/MixImportModesA.dhall @@ -0,0 +1 @@ +{ n = ../../data/simple.dhall, txt = ../../data/simple.dhall as Text, loc = ../../data/simple.dhall as Location } diff --git a/dhall/tests/import/success/unit/MixImportModesB.dhall b/dhall/tests/import/success/unit/MixImportModesB.dhall new file mode 100644 index 0000000..a4e02f5 --- /dev/null +++ b/dhall/tests/import/success/unit/MixImportModesB.dhall @@ -0,0 +1 @@ +{ loc = < Environment: Text | Local: Text | Missing | Remote: Text >.Local "./dhall/tests/import/data/simple.dhall", n = < Environment: Text | Local: Text | Missing | Remote: Text >.Local "./dhall/tests/import/data/simple.dhall", txt = < Environment: Text | Local: Text | Missing | Remote: Text >.Local "./dhall/tests/import/data/simple.dhall" } diff --git a/dhall/tests/spec.rs b/dhall/tests/spec.rs index 6b156f6..d3db321 100644 --- a/dhall/tests/spec.rs +++ b/dhall/tests/spec.rs @@ -535,6 +535,8 @@ fn ignore_test(variant: SpecTestKind, path: &str) -> bool { // Failing for now, we should fix that. let is_failing_for_now = false + // TODO: fix that one + // || path == "import/success/unit/MixImportModes" // TODO: fails because of caching issues. || path == "type-inference/success/prelude" // TODO: do not recover from cyclic imports -- cgit v1.2.3 From 66dcbc5a6142693e79f89a837a3145ac6f810d3c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 6 Dec 2020 17:26:50 +0000 Subject: Prepare `ImportLocation` for more fields --- dhall/tests/import/failure/cycle.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dhall/tests') diff --git a/dhall/tests/import/failure/cycle.txt b/dhall/tests/import/failure/cycle.txt index 899484b..a103312 100644 --- a/dhall/tests/import/failure/cycle.txt +++ b/dhall/tests/import/failure/cycle.txt @@ -10,7 +10,7 @@ Type error: error: error --> :1:1 | 1 | ../data/cycle.dhall - | ^^^^^^^^^^^^^^^^^^^ ImportCycle([Local("./dhall-lang/tests/import/data/cycle.dhall"), Local("./dhall-lang/tests/import/failure/cycle.dhall")], Local("./dhall-lang/tests/import/data/cycle.dhall")) + | ^^^^^^^^^^^^^^^^^^^ ImportCycle([ImportLocation { kind: Local("./dhall-lang/tests/import/data/cycle.dhall") }, ImportLocation { kind: Local("./dhall-lang/tests/import/failure/cycle.dhall") }], ImportLocation { kind: Local("./dhall-lang/tests/import/data/cycle.dhall") }) | | | -- cgit v1.2.3 From 6eb3612345c34e67acdc71662ea94f0952a48fd9 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 6 Dec 2020 17:47:32 +0000 Subject: An import location is not independent from the import mode --- dhall/tests/import/failure/cycle.txt | 2 +- dhall/tests/import/success/unit/MixImportModesB.dhall | 2 +- dhall/tests/spec.rs | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'dhall/tests') diff --git a/dhall/tests/import/failure/cycle.txt b/dhall/tests/import/failure/cycle.txt index a103312..641667f 100644 --- a/dhall/tests/import/failure/cycle.txt +++ b/dhall/tests/import/failure/cycle.txt @@ -10,7 +10,7 @@ Type error: error: error --> :1:1 | 1 | ../data/cycle.dhall - | ^^^^^^^^^^^^^^^^^^^ ImportCycle([ImportLocation { kind: Local("./dhall-lang/tests/import/data/cycle.dhall") }, ImportLocation { kind: Local("./dhall-lang/tests/import/failure/cycle.dhall") }], ImportLocation { kind: Local("./dhall-lang/tests/import/data/cycle.dhall") }) + | ^^^^^^^^^^^^^^^^^^^ ImportCycle([ImportLocation { kind: Local("./dhall-lang/tests/import/data/cycle.dhall"), mode: Code }, ImportLocation { kind: Local("./dhall-lang/tests/import/failure/cycle.dhall"), mode: Code }], ImportLocation { kind: Local("./dhall-lang/tests/import/data/cycle.dhall"), mode: Code }) | | | diff --git a/dhall/tests/import/success/unit/MixImportModesB.dhall b/dhall/tests/import/success/unit/MixImportModesB.dhall index a4e02f5..430e0bc 100644 --- a/dhall/tests/import/success/unit/MixImportModesB.dhall +++ b/dhall/tests/import/success/unit/MixImportModesB.dhall @@ -1 +1 @@ -{ loc = < Environment: Text | Local: Text | Missing | Remote: Text >.Local "./dhall/tests/import/data/simple.dhall", n = < Environment: Text | Local: Text | Missing | Remote: Text >.Local "./dhall/tests/import/data/simple.dhall", txt = < Environment: Text | Local: Text | Missing | Remote: Text >.Local "./dhall/tests/import/data/simple.dhall" } +{ loc = < Environment: Text | Local: Text | Missing | Remote: Text >.Local "./dhall/tests/import/data/simple.dhall", n = 3, txt = "3\n" } diff --git a/dhall/tests/spec.rs b/dhall/tests/spec.rs index d3db321..6b156f6 100644 --- a/dhall/tests/spec.rs +++ b/dhall/tests/spec.rs @@ -535,8 +535,6 @@ fn ignore_test(variant: SpecTestKind, path: &str) -> bool { // Failing for now, we should fix that. let is_failing_for_now = false - // TODO: fix that one - // || path == "import/success/unit/MixImportModes" // TODO: fails because of caching issues. || path == "type-inference/success/prelude" // TODO: do not recover from cyclic imports -- cgit v1.2.3 From ee941f668977b66d9d829bc9c359f3a3b64f9dc1 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 6 Dec 2020 18:06:38 +0000 Subject: Exclude the new test on Windows --- dhall/tests/spec.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'dhall/tests') diff --git a/dhall/tests/spec.rs b/dhall/tests/spec.rs index 6b156f6..646083a 100644 --- a/dhall/tests/spec.rs +++ b/dhall/tests/spec.rs @@ -519,6 +519,7 @@ fn ignore_test(variant: SpecTestKind, path: &str) -> bool { // Paths on windows have backslashes; this breaks many things. This is undefined in the // spec; see https://github.com/dhall-lang/dhall-lang/issues/1032 || (variant == ImportSuccess && path.contains("asLocation")) + || path == "import/success/unit/MixImportModes" || variant == ImportFailure; // Only include in release tests. -- cgit v1.2.3