diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-01-09 13:31:20 +0100 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-01-09 13:31:20 +0100 |
commit | c9373d5b6173c641434e3fa7c53f09b3b88d9161 (patch) | |
tree | 69f7a4583afd205a814cd8bf4a2c8424dd58925d /test | |
parent | 938bbdd8077e9f22b047b84a2209f55f737790f3 (diff) |
refactoring
Diffstat (limited to 'test')
-rw-r--r-- | test/runTests.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/runTests.hs b/test/runTests.hs index 1100e179..b84181bd 100644 --- a/test/runTests.hs +++ b/test/runTests.hs | |||
@@ -22,7 +22,7 @@ import Control.DeepSeq | |||
22 | import qualified Data.Set as Set | 22 | import qualified Data.Set as Set |
23 | 23 | ||
24 | import LambdaCube.Compiler.Pretty hiding ((</>)) | 24 | import LambdaCube.Compiler.Pretty hiding ((</>)) |
25 | import LambdaCube.Compiler.CGExp | 25 | import LambdaCube.Compiler.CGExp (tyOf, outputType, boolType, trueExp) |
26 | import LambdaCube.Compiler.Driver | 26 | import LambdaCube.Compiler.Driver |
27 | import LambdaCube.Compiler.CoreToIR | 27 | import LambdaCube.Compiler.CoreToIR |
28 | import IR (Backend(..)) | 28 | import IR (Backend(..)) |
@@ -95,11 +95,10 @@ acceptTests reject = testFrame reject [acceptPath, rejectPath] $ \case | |||
95 | Right (Left e, i) -> Right ("typechecked", unlines $ e: "tooltips:": [showRange (b, e) ++ " " ++ m | (b, e, m) <- i]) | 95 | Right (Left e, i) -> Right ("typechecked", unlines $ e: "tooltips:": [showRange (b, e) ++ " " ++ m | (b, e, m) <- i]) |
96 | Right (Right e, i) | 96 | Right (Right e, i) |
97 | | True <- i `deepseq` False -> error "impossible" | 97 | | True <- i `deepseq` False -> error "impossible" |
98 | | tyOf e == TCon0 "Output" | 98 | | tyOf e == outputType |
99 | -> Right ("compiled main", show . compilePipeline True OpenGL33 $ e) | 99 | -> Right ("compiled main", show . compilePipeline True OpenGL33 $ e) |
100 | | tyOf e == TCon0 "Bool" -> case e of | 100 | | e == trueExp -> Right ("main ~~> True", ppShow e) |
101 | x@(A0 "True") -> Right ("main ~~> True", ppShow x) | 101 | | tyOf e == boolType -> Left $ "main should be True but it is \n" ++ ppShow e |
102 | x -> Left $ "main should be True but it is \n" ++ ppShow x | ||
103 | | otherwise -> Right ("reduced main " ++ ppShow (tyOf e), ppShow e) | 102 | | otherwise -> Right ("reduced main " ++ ppShow (tyOf e), ppShow e) |
104 | -- | otherwise -> Right ("System-F main ", ppShow . toCore mempty $ e) | 103 | -- | otherwise -> Right ("System-F main ", ppShow . toCore mempty $ e) |
105 | 104 | ||