Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit da85c69

Browse files
committed
Correct the types in the spec.
1 parent c2812f8 commit da85c69

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

semantic-core/test/Spec.hs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ import Data.Core
1818
import Data.Core.Pretty
1919
import Data.Core.Parser as Parse
2020
import Data.Name
21+
import Data.Term
2122

2223
-- * Helpers
2324

24-
true, false :: Core
25+
true, false :: Term Core Name
2526
true = Bool True
2627
false = Bool False
2728

@@ -33,7 +34,7 @@ parseEither p = Trifecta.foldResult (Left . show . Trifecta._errDoc) Right . Tri
3334
-- * Parser roundtripping properties. Note that parsing and prettyprinting is generally
3435
-- not a roundtrip, because the parser inserts 'Ann' nodes itself.
3536

36-
prop_roundtrips :: Gen Core -> Property
37+
prop_roundtrips :: Gen (Term Core Name) -> Property
3738
prop_roundtrips gen = property $ do
3839
input <- forAll gen
3940
tripping input showCore (parseEither (Parse.core <* Trifecta.eof))
@@ -48,7 +49,7 @@ parserProps = testGroup "Parsing: roundtripping"
4849

4950
-- * Parser specs
5051

51-
parsesInto :: String -> Core -> Assertion
52+
parsesInto :: String -> Term Core Name -> Assertion
5253
parsesInto str res = case parseEither Parse.core str of
5354
Right x -> x @?= res
5455
Left m -> assertFailure m
@@ -58,7 +59,7 @@ assert_booleans_parse = do
5859
parseEither Parse.core "#true" @?= Right true
5960
parseEither Parse.core "#false" @?= Right false
6061

61-
a, f, g, h :: Core
62+
a, f, g, h :: Term Core Name
6263
(a, f, g, h) = (Var "a", Var "f", Var "g", Var "h")
6364

6465
assert_ifthen_parse :: Assertion
@@ -102,7 +103,7 @@ parserSpecs = testGroup "Parsing: simple specs"
102103
, testCase "let in push" assert_let_in_push_precedence
103104
]
104105

105-
assert_roundtrips :: File Core -> Assertion
106+
assert_roundtrips :: File (Term Core Name) -> Assertion
106107
assert_roundtrips (File _ core) = parseEither Parse.core (showCore core) @?= Right (stripAnnotations core)
107108

108109
parserExamples :: TestTree

0 commit comments

Comments
 (0)