ghc-mod/test/DebugSpec.hs

24 lines
701 B
Haskell
Raw Normal View History

2013-03-13 04:37:17 +00:00
module DebugSpec where
import Expectation
2013-05-20 02:29:44 +00:00
import Language.Haskell.GhcMod
2013-03-13 04:37:17 +00:00
import Test.Hspec
checkFast :: String -> String -> IO ()
checkFast file ans = withDirectory_ "test/data" $ do
(strVer,_) <- getGHCVersion
cradle <- findCradle Nothing strVer
2013-05-20 02:29:44 +00:00
res <- debugInfo defaultOptions cradle strVer file
lines res `shouldContain` ans
2013-03-13 04:37:17 +00:00
spec :: Spec
spec = do
describe "debug" $ do
it "can check TH" $ do
checkFast "Main.hs" "Fast check: No"
checkFast "Foo.hs" "Fast check: Yes"
checkFast "Bar.hs" "Fast check: No"
it "can check QuasiQuotes" $ do
checkFast "Baz.hs" "Fast check: No"