From fa65d7269ecac86fcb76d4944b5c9b9edbff958a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Tue, 12 Aug 2014 18:22:28 +0200 Subject: [PATCH] Add a test for gmsGet/Put --- Language/Haskell/GhcMod/Monad.hs | 2 ++ test/MonadSpec.hs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/Language/Haskell/GhcMod/Monad.hs b/Language/Haskell/GhcMod/Monad.hs index 3b99b1a..92e6ac2 100644 --- a/Language/Haskell/GhcMod/Monad.hs +++ b/Language/Haskell/GhcMod/Monad.hs @@ -23,6 +23,8 @@ module Language.Haskell.GhcMod.Monad ( -- ** Conversion , toGhcModT -- ** Accessing 'GhcModEnv' and 'GhcModState' + , gmsGet + , gmsPut , options , cradle , getCompilerMode diff --git a/test/MonadSpec.hs b/test/MonadSpec.hs index 938f763..49f8198 100644 --- a/test/MonadSpec.hs +++ b/test/MonadSpec.hs @@ -25,3 +25,8 @@ spec = do describe "runGhcModT" $ it "complains if the cabal file fails to parse while a sandbox is present" $ withDirectory_ "test/data/broken-cabal" $ do shouldReturnError $ runD' (gmCradle <$> ask) + + describe "gmsGet/Put" $ + it "work" $ do + (runD $ gmsPut (GhcModState Intelligent) >> gmsGet) + `shouldReturn` (GhcModState Intelligent)