ghc-mod/test/DebugSpec.hs
Kazu Yamamoto 49791fb6ea Supporting sandbox sharing.
Braking backword compatibility of findCradle.
2013-09-20 15:48:50 +09:00

25 lines
681 B
Haskell

module DebugSpec where
import Language.Haskell.GhcMod
import Test.Hspec
import Dir
checkFast :: String -> String -> IO ()
checkFast file ans = withDirectory_ "test/data" $ do
(strVer,_) <- getGHCVersion
cradle <- findCradle
res <- debugInfo defaultOptions cradle strVer file
lines res `shouldContain` [ans]
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"