1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-14 17:32:00 +03:00
juvix/test/VampIR/Compilation/Negative.hs
2023-06-15 16:42:58 +02:00

38 lines
807 B
Haskell

module VampIR.Compilation.Negative where
import Base
import VampIR.Compilation.Base
data NegTest = NegTest
{ _name :: String,
_relDir :: Path Rel Dir,
_file :: Path Rel File
}
root :: Path Abs Dir
root = relToProject $(mkRelDir "tests/VampIR/negative")
testDescr :: NegTest -> TestDescr
testDescr NegTest {..} =
let tRoot = root <//> _relDir
file' = tRoot <//> _file
in TestDescr
{ _testName = _name,
_testRoot = tRoot,
_testAssertion = Steps $ vampirCompileErrorAssertion file'
}
allTests :: TestTree
allTests =
testGroup
"Juvix to VampIR compilation negative tests"
(map (mkTest . testDescr) tests)
tests :: [NegTest]
tests =
[ NegTest
"Test001: Missing comma"
$(mkRelDir ".")
$(mkRelFile "test001.juvix")
]