1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-15 01:52:11 +03:00
juvix/test/Compilation/Negative.hs
Jan Mas Rovira 39b797ecfa
Add Bottom node (#2112)
- Closes #2056 
- Depends on #2103 

I am not sure about the implementation of `isType` for `NBot`. (solved).

The `Eq` instance returns `True` for every two `Bottom` terms,
regardless of their type.

---------

Co-authored-by: Jonathan Cubides <jonathan.cubides@uib.no>
Co-authored-by: Lukasz Czajka <lukasz@heliax.dev>
2023-05-23 18:31:28 +02:00

54 lines
1.2 KiB
Haskell

module Compilation.Negative where
import Base
import Compilation.Base
data NegTest = NegTest
{ _name :: String,
_relDir :: Path Rel Dir,
_file :: Path Rel File
}
root :: Path Abs Dir
root = relToProject $(mkRelDir "tests/Compilation/negative")
testDescr :: NegTest -> TestDescr
testDescr NegTest {..} =
let tRoot = root <//> _relDir
file' = tRoot <//> _file
in TestDescr
{ _testName = _name,
_testRoot = tRoot,
_testAssertion = Steps $ compileErrorAssertion file'
}
allTests :: TestTree
allTests =
testGroup
"Juvix compilation pipeline negative tests"
(map (mkTest . testDescr) tests)
tests :: [NegTest]
tests =
[ NegTest
"Test001: Pattern matching coverage"
$(mkRelDir ".")
$(mkRelFile "test001.juvix"),
NegTest
"Test002: Pattern matching coverage in cases"
$(mkRelDir ".")
$(mkRelFile "test002.juvix"),
NegTest
"Test003: Pattern matching coverage in lambdas"
$(mkRelDir ".")
$(mkRelFile "test003.juvix"),
NegTest
"Test004: The definition of main has a function type"
$(mkRelDir ".")
$(mkRelFile "test004.juvix"),
NegTest
"Test005: Axiom"
$(mkRelDir ".")
$(mkRelFile "test005.juvix")
]