2022-04-05 23:02:03 +03:00
|
|
|
module TypeCheck.Positive where
|
|
|
|
|
|
|
|
import Base
|
2022-04-08 13:46:37 +03:00
|
|
|
import MiniJuvix.Pipeline
|
2022-04-05 23:02:03 +03:00
|
|
|
|
|
|
|
data PosTest = PosTest
|
2022-04-08 13:46:37 +03:00
|
|
|
{ _name :: String,
|
|
|
|
_relDir :: FilePath,
|
|
|
|
_file :: FilePath
|
2022-04-05 23:02:03 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
root :: FilePath
|
|
|
|
root = "tests/positive"
|
|
|
|
|
|
|
|
testDescr :: PosTest -> TestDescr
|
|
|
|
testDescr PosTest {..} =
|
2022-04-08 13:46:37 +03:00
|
|
|
let tRoot = root </> _relDir
|
|
|
|
in TestDescr
|
|
|
|
{ _testName = _name,
|
|
|
|
_testRoot = tRoot,
|
|
|
|
_testAssertion = Single $ do
|
|
|
|
let entryPoint = EntryPoint "." (pure _file)
|
|
|
|
(void . runIO) (upToMicroJuvixTyped entryPoint)
|
|
|
|
}
|
2022-04-05 23:02:03 +03:00
|
|
|
|
|
|
|
allTests :: TestTree
|
|
|
|
allTests =
|
|
|
|
testGroup
|
|
|
|
"Scope positive tests"
|
|
|
|
(map (mkTest . testDescr) tests)
|
|
|
|
|
|
|
|
tests :: [PosTest]
|
|
|
|
tests =
|
|
|
|
[ PosTest
|
|
|
|
"Simple"
|
|
|
|
"MicroJuvix"
|
|
|
|
"Simple.mjuvix",
|
|
|
|
PosTest
|
|
|
|
"Literal String matches any type"
|
|
|
|
"MicroJuvix"
|
|
|
|
"LiteralString.mjuvix",
|
|
|
|
PosTest
|
|
|
|
"Literal Int matches any type"
|
|
|
|
"MicroJuvix"
|
|
|
|
"LiteralInt.mjuvix",
|
|
|
|
PosTest
|
|
|
|
"GHC backend Hello World"
|
|
|
|
"MiniHaskell"
|
|
|
|
"HelloWorld.mjuvix",
|
|
|
|
PosTest
|
2022-05-06 13:45:09 +03:00
|
|
|
"GHC backend MonoSimpleFungibleToken"
|
|
|
|
"FullExamples"
|
|
|
|
"MonoSimpleFungibleToken.mjuvix",
|
2022-04-05 23:02:03 +03:00
|
|
|
PosTest
|
|
|
|
"Axiom"
|
|
|
|
"."
|
|
|
|
"Axiom.mjuvix",
|
|
|
|
PosTest
|
|
|
|
"Inductive"
|
|
|
|
"."
|
|
|
|
"Inductive.mjuvix",
|
|
|
|
PosTest
|
|
|
|
"Operators"
|
|
|
|
"."
|
2022-04-22 11:06:34 +03:00
|
|
|
"Operators.mjuvix",
|
|
|
|
PosTest
|
|
|
|
"Polymorphism and higher rank functions"
|
|
|
|
"."
|
|
|
|
"Polymorphism.mjuvix"
|
2022-04-05 23:02:03 +03:00
|
|
|
]
|