Skip to content

Commit

Permalink
Add a kind annotation to the type variable of generated fixtures
Browse files Browse the repository at this point in the history
fixes #28
  • Loading branch information
lexi-lambda committed Nov 14, 2016
1 parent 33efb1a commit 2c0355b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Control/Monad/TestFixture/TH/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ mkFixtureRecord fixtureName classNames = do
fixtureFields <- join <$> zipWithM (methodsToFields mVar) types methods
let fixtureCs = [RecC fixtureName fixtureFields]

let fixtureDec = mkDataD [] fixtureName [PlainTV mVar] fixtureCs
let mKind = AppT (AppT ArrowT StarT) StarT
let fixtureDec = mkDataD [] fixtureName [KindedTV mVar mKind] fixtureCs
return (fixtureDec, fixtureFields)

mkFixtureTypeSynonyms :: Name -> Q [Dec]
Expand Down
3 changes: 3 additions & 0 deletions test/Test/Control/Monad/TestFixtureSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ fixtureStateT = def :: Fixture (TestFixtureT Fixture () s m)
fixtureLogStateT :: Monad m => FixtureLogStateT log state m
fixtureLogStateT = def :: Fixture (TestFixtureT Fixture log state m)

-- ensure generation of empty fixtures works
mkFixture "EmptyFixture" []

spec :: Spec
spec = do
describe "mkFixture" $
Expand Down

0 comments on commit 2c0355b

Please sign in to comment.