mirror of
https://github.com/anoma/juvix.git
synced 2024-12-01 00:04:58 +03:00
[test] Add ambiguity tests
This commit is contained in:
parent
660c034d06
commit
86110e063a
@ -106,4 +106,9 @@ tests = [
|
||||
"WrongModuleName.mjuvix" $ \case
|
||||
ErrWrongTopModuleName {} -> Nothing
|
||||
_ -> wrongError
|
||||
, NegTest "Ambiguous export"
|
||||
"."
|
||||
"AmbiguousExport.mjuvix" $ \case
|
||||
ErrMultipleExport {} -> Nothing
|
||||
_ -> wrongError
|
||||
]
|
||||
|
@ -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"
|
||||
]
|
||||
|
16
tests/negative/AmbiguousExport.mjuvix
Normal file
16
tests/negative/AmbiguousExport.mjuvix
Normal 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;
|
22
tests/positive/QualifiedConstructor/M.mjuvix
Normal file
22
tests/positive/QualifiedConstructor/M.mjuvix
Normal 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;
|
14
tests/positive/QualifiedSymbol/M.mjuvix
Normal file
14
tests/positive/QualifiedSymbol/M.mjuvix
Normal 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;
|
3
tests/positive/QualifiedSymbol2/M.mjuvix
Normal file
3
tests/positive/QualifiedSymbol2/M.mjuvix
Normal file
@ -0,0 +1,3 @@
|
||||
module M;
|
||||
|
||||
end;
|
10
tests/positive/QualifiedSymbol2/N.mjuvix
Normal file
10
tests/positive/QualifiedSymbol2/N.mjuvix
Normal file
@ -0,0 +1,10 @@
|
||||
module N;
|
||||
import M;
|
||||
|
||||
module M;
|
||||
axiom A : Type;
|
||||
end;
|
||||
|
||||
axiom B : M.A;
|
||||
|
||||
end;
|
Loading…
Reference in New Issue
Block a user