2013-03-13 04:37:17 +00:00
|
|
|
module DebugSpec where
|
|
|
|
|
2013-05-20 02:29:44 +00:00
|
|
|
import Language.Haskell.GhcMod
|
2013-03-13 04:37:17 +00:00
|
|
|
import Test.Hspec
|
|
|
|
|
2013-09-03 02:49:35 +00:00
|
|
|
import Dir
|
|
|
|
|
2013-03-13 04:37:17 +00:00
|
|
|
checkFast :: String -> String -> IO ()
|
|
|
|
checkFast file ans = withDirectory_ "test/data" $ do
|
2014-01-30 11:42:25 +00:00
|
|
|
let cradle = Cradle "." Nothing Nothing [] []
|
2013-09-20 08:15:41 +00:00
|
|
|
res <- debugInfo defaultOptions cradle file
|
2013-09-03 02:44:59 +00:00
|
|
|
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"
|
2013-04-01 06:55:29 +00:00
|
|
|
|
|
|
|
it "can check QuasiQuotes" $ do
|
|
|
|
checkFast "Baz.hs" "Fast check: No"
|