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