1
1
mirror of https://github.com/anoma/juvix.git synced 2024-09-19 04:27:20 +03:00

[test] Add ambiguity tests

This commit is contained in:
Paul Cadman 2022-03-24 10:22:03 +00:00
parent 660c034d06
commit 86110e063a
7 changed files with 76 additions and 0 deletions

View File

@ -106,4 +106,9 @@ tests = [
"WrongModuleName.mjuvix" $ \case
ErrWrongTopModuleName {} -> Nothing
_ -> wrongError
, NegTest "Ambiguous export"
"."
"AmbiguousExport.mjuvix" $ \case
ErrMultipleExport {} -> Nothing
_ -> wrongError
]

View File

@ -79,4 +79,10 @@ tests = [
"." "Axiom.mjuvix"
, PosTest "Foreign block parsing"
"." "Foreign.mjuvix"
, PosTest "Multiple modules non-ambiguous symbol - same file"
"QualifiedSymbol" "M.mjuvix"
, PosTest "Multiple modules non-ambiguous symbol"
"QualifiedSymbol2" "N.mjuvix"
, PosTest "Multiple modules constructor non-ambiguous symbol"
"QualifiedConstructor" "M.mjuvix"
]

View File

@ -0,0 +1,16 @@
module AmbiguousExport;
module N;
module O;
inductive T {
A : T;
};
end;
end;
open N public;
module O;
axiom A : Type;
end;
end;

View File

@ -0,0 +1,22 @@
module M;
module N;
module O;
inductive T {
A : T;
};
end;
end;
open N;
open O using { T; A };
module O;
axiom A : Type;
end;
open O;
fun : T → T;
fun A ≔ T;
end;

View File

@ -0,0 +1,14 @@
module M;
module N;
module O;
axiom A : Type;
end;
end;
open N;
module O;
end;
axiom B : O.A;
end;

View File

@ -0,0 +1,3 @@
module M;
end;

View File

@ -0,0 +1,10 @@
module N;
import M;
module M;
axiom A : Type;
end;
axiom B : M.A;
end;