2022-05-04 11:50:03 +03:00
|
|
|
module MonoJuvix.Positive where
|
|
|
|
|
|
|
|
import Base
|
2022-07-08 14:59:45 +03:00
|
|
|
import Juvix.Pipeline
|
2022-05-04 11:50:03 +03:00
|
|
|
|
|
|
|
data PosTest = PosTest
|
|
|
|
{ _name :: String,
|
|
|
|
_relDir :: FilePath,
|
|
|
|
_file :: FilePath
|
|
|
|
}
|
|
|
|
|
|
|
|
root :: FilePath
|
|
|
|
root = "tests/positive"
|
|
|
|
|
|
|
|
testDescr :: PosTest -> TestDescr
|
|
|
|
testDescr PosTest {..} =
|
|
|
|
let tRoot = root </> _relDir
|
|
|
|
in TestDescr
|
|
|
|
{ _testName = _name,
|
|
|
|
_testRoot = tRoot,
|
|
|
|
_testAssertion = Single $ do
|
2022-05-30 14:40:52 +03:00
|
|
|
let entryPoint = defaultEntryPoint _file
|
2022-05-04 11:50:03 +03:00
|
|
|
(void . runIO) (upToMonoJuvix entryPoint)
|
|
|
|
}
|
|
|
|
|
|
|
|
allTests :: TestTree
|
|
|
|
allTests =
|
|
|
|
testGroup
|
|
|
|
"MonoJuvix positive tests"
|
|
|
|
(map (mkTest . testDescr) tests)
|
|
|
|
|
|
|
|
tests :: [PosTest]
|
|
|
|
tests =
|
|
|
|
[ PosTest
|
|
|
|
"General example"
|
|
|
|
"."
|
2022-07-08 14:59:45 +03:00
|
|
|
"Polymorphism.juvix",
|
2022-05-04 11:50:03 +03:00
|
|
|
PosTest
|
|
|
|
"Polymorphic Simple Fungible Token"
|
2022-05-06 13:45:09 +03:00
|
|
|
"FullExamples"
|
2022-07-08 14:59:45 +03:00
|
|
|
"SimpleFungibleTokenImplicit.juvix",
|
2022-06-01 18:54:53 +03:00
|
|
|
PosTest
|
|
|
|
"Polymorphism and higher rank functions with explicit holes"
|
|
|
|
"."
|
2022-07-08 14:59:45 +03:00
|
|
|
"PolymorphismHoles.juvix"
|
2022-05-04 11:50:03 +03:00
|
|
|
]
|