diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-02-13 14:54:36 +0100 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-02-13 14:54:50 +0100 |
commit | 0acea3e60e03418dcc0fe6346d8115769a2b4c17 (patch) | |
tree | 556e9e10667bac81560d6e392a4aba55f600b614 /test | |
parent | a8ece97efac68c03b3eb9c9e962b8a9b1d994519 (diff) |
use different kinf of infos
Diffstat (limited to 'test')
-rw-r--r-- | test/UnitTests.hs | 7 | ||||
-rw-r--r-- | test/runTests.hs | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/test/UnitTests.hs b/test/UnitTests.hs index 558f1f28..7b592ef6 100644 --- a/test/UnitTests.hs +++ b/test/UnitTests.hs | |||
@@ -19,7 +19,7 @@ import LambdaCube.Compiler.Infer | |||
19 | main = defaultMain $ testGroup "Compiler" | 19 | main = defaultMain $ testGroup "Compiler" |
20 | [ testGroup "Infer" $ concat [ | 20 | [ testGroup "Infer" $ concat [ |
21 | monoidTestProperties "SI" (arbitrary :: Gen SI) | 21 | monoidTestProperties "SI" (arbitrary :: Gen SI) |
22 | , monoidTestProperties "Infos" (arbitrary :: Gen Infos) | 22 | -- , monoidTestProperties "Infos" (arbitrary :: Gen Infos) -- list is always a monoid |
23 | , monoidTestProperties "MaxDB" (arbitrary :: Gen MaxDB) | 23 | , monoidTestProperties "MaxDB" (arbitrary :: Gen MaxDB) |
24 | ] | 24 | ] |
25 | ] | 25 | ] |
@@ -59,6 +59,9 @@ instance TestShow SI where | |||
59 | testShow (RangeSI a) = "RangeSI " ++ show a | 59 | testShow (RangeSI a) = "RangeSI " ++ show a |
60 | 60 | ||
61 | -- Infos | 61 | -- Infos |
62 | {- list is always a monoid | ||
63 | instance Arbitrary Info where | ||
64 | arbitrary = Info <$> arbitrary | ||
62 | 65 | ||
63 | instance Arbitrary Infos where | 66 | instance Arbitrary Infos where |
64 | arbitrary = Infos . Map.fromList <$> arbitrary | 67 | arbitrary = Infos . Map.fromList <$> arbitrary |
@@ -71,7 +74,7 @@ instance MonoidEq Infos where | |||
71 | 74 | ||
72 | instance TestShow Infos where | 75 | instance TestShow Infos where |
73 | testShow (Infos i) = "Infos " ++ show i | 76 | testShow (Infos i) = "Infos " ++ show i |
74 | 77 | -} | |
75 | -- MaxDB | 78 | -- MaxDB |
76 | 79 | ||
77 | instance Arbitrary MaxDB where | 80 | instance Arbitrary MaxDB where |
diff --git a/test/runTests.hs b/test/runTests.hs index 75f88525..5d2cc860 100644 --- a/test/runTests.hs +++ b/test/runTests.hs | |||
@@ -186,8 +186,7 @@ doTest Config{..} (i, fn) = do | |||
186 | Left e -> Left (tab "!Failed" e, Failed) | 186 | Left e -> Left (tab "!Failed" e, Failed) |
187 | Right (fname, Left e, i) | 187 | Right (fname, Left e, i) |
188 | -> Right ("typechecked module" | 188 | -> Right ("typechecked module" |
189 | , unlines $ e: "tooltips:": [ ppShow r ++ " " ++ intercalate " | " m | 189 | , unlines $ e: listAllInfos i) |
190 | | (r, m) <- listInfos i]) | ||
191 | Right (fname, Right (e, te), i) | 190 | Right (fname, Right (e, te), i) |
192 | | True <- i `deepseq` False -> error "impossible" | 191 | | True <- i `deepseq` False -> error "impossible" |
193 | | te == outputType -> Right ("compiled pipeline", show $ compilePipeline OpenGL33 (e, te)) | 192 | | te == outputType -> Right ("compiled pipeline", show $ compilePipeline OpenGL33 (e, te)) |