From 57c56564d15cd5c83a4f1d1bab5490e6b75e8656 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 18 Jan 2016 12:09:36 +0000 Subject: Moved Printout.BBCode to own module --- spec/test/Thermoprint/Printout/BBCodeSpec.hs | 42 ---------------------------- 1 file changed, 42 deletions(-) delete mode 100644 spec/test/Thermoprint/Printout/BBCodeSpec.hs (limited to 'spec/test') diff --git a/spec/test/Thermoprint/Printout/BBCodeSpec.hs b/spec/test/Thermoprint/Printout/BBCodeSpec.hs deleted file mode 100644 index f3f1840..0000000 --- a/spec/test/Thermoprint/Printout/BBCodeSpec.hs +++ /dev/null @@ -1,42 +0,0 @@ -{-# LANGUAGE OverloadedStrings, OverloadedLists #-} -{-# LANGUAGE StandaloneDeriving #-} - -module Thermoprint.Printout.BBCodeSpec (spec) where - -import Test.Hspec -import Test.Hspec.QuickCheck (prop) -import Test.QuickCheck.Instances - -import Thermoprint.Printout.BBCode -import Thermoprint.Printout - -import Data.Text (Text) - -import Control.Monad (zipWithM_) -import Data.Monoid ((<>)) -import Data.Function (on) - -import qualified Data.Sequence as Seq (fromList) - -instance Eq Block where - (==) = (==) `on` cotext -deriving instance Eq Chunk - -spec :: Spec -spec = do - zipWithM_ example [1..] examples - where - example n (s, ts) = let str = "Example " <> show n - in specify str $ bbcode s == (pOut <$> ts) - -pOut :: [Block] -> Printout -pOut = pure . Seq.fromList . map Cooked - -examples :: [(Text, Either BBCodeError [Block])] -examples = [ ("Hello World!" - , Right [Line (JuxtaPos [word "Hello", HSpace 1, word "World!"])]) - , ("Hello [hspace width=2/] World!" - , Right [Line (JuxtaPos [word "Hello", HSpace 4, word "World!"])]) - ] - where - word = (\(Right l) -> l) . text -- cgit v1.2.3