{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE QuasiQuotes #-} module Examples ( testExamples ) where import Test.Framework ( Test , testGroup ) import Test.Framework.Providers.HUnit ( testCase ) import Test.HUnit ( assertEqual ) import Data.Text ( Text ) import qualified Data.Text as T ( pack ) import Zenacy.HTML testExamples :: Test testExamples = testGroup "Examples" [ testMisnested , testUnexpected , testUnclosed ] testMisnested :: Test testMisnested = testCase "Misnested tags" $ do flip (assertEqual "13.2.10.1 Misnested tags") (htmlRender $ htmlParseEasy "
12345
") "12345
" flip (assertEqual "13.2.10.2 Misnested tags") (htmlRender $ htmlParseEasy "123
") "123
" testUnexpected :: Test testUnexpected = testCase "Unexpected markup in tables" $ do flip (assertEqual "13.2.10.3 Unexpected markup in tables") (htmlRender $ htmlParseEasy "aaa |
aaa |
X\ \
X\ \
X\ \
X") "
\ \\ \\ \\ \\ \\ \\ \X\ \\ \\ \\ \\ \\ \
\ \\ \\ \\ \\ \\ \X\ \\ \\ \\ \\ \
\ \\ \\ \\ \\ \\ \\ \\ \\ \X\ \\ \\ \\ \\ \\ \\ \\ \
\ \X
\ \"