{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Text.MMark.Extension.GhcSyntaxHighlighterSpec (spec) where import Test.Hspec import Text.MMark.Extension.GhcSyntaxHighlighter import Text.MMark.Extension.TestUtils spec :: Spec spec = describe "ghcSyntaxHighlighter" $ do let to = withExt ghcSyntaxHighlighter context "when info string is not \"haskell\"" $ it "has no effect" $ "```foo\nmain :: IO ()\nmain = return ()\n```\n" `to` "
main :: IO ()\nmain = return ()\n
\n" #if __GLASGOW_HASKELL__ >= 804 context "with info string is \"haskell\"" $ it "renders it correctly" $ "```haskell\nmain :: IO ()\nmain = return ()\n```\n" `to` "
main :: IO ()\nmain = return ()\n
\n" #endif