1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-14 17:32:00 +03:00
juvix/test/TypeCheck/Positive.hs

71 lines
1.4 KiB
Haskell
Raw Normal View History

module TypeCheck.Positive where
import Base
2022-04-08 13:46:37 +03:00
import MiniJuvix.Pipeline
data PosTest = PosTest
2022-04-08 13:46:37 +03:00
{ _name :: String,
_relDir :: FilePath,
_file :: FilePath
}
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)
}
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
"GHC backend MonoSimpleFungibleToken"
"FullExamples"
"MonoSimpleFungibleToken.mjuvix",
PosTest
"Axiom"
"."
"Axiom.mjuvix",
PosTest
"Inductive"
"."
"Inductive.mjuvix",
PosTest
"Operators"
"."
"Operators.mjuvix",
PosTest
"Polymorphism and higher rank functions"
"."
"Polymorphism.mjuvix"
]