aboutsummaryrefslogtreecommitdiff
path: root/tp-bbcode
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-01-19 17:29:36 +0000
committerGregor Kleen <gkleen@yggdrasil.li>2016-01-19 17:29:36 +0000
commit32d779b5de22b9ebe321a367a2a2749eef06103c (patch)
treee9950c3a57254de7d91d17eceeebc8b2d328ef8e /tp-bbcode
parenta1dbc24787c9da9d8219446444a2957a332090d9 (diff)
downloadthermoprint-32d779b5de22b9ebe321a367a2a2749eef06103c.tar
thermoprint-32d779b5de22b9ebe321a367a2a2749eef06103c.tar.gz
thermoprint-32d779b5de22b9ebe321a367a2a2749eef06103c.tar.bz2
thermoprint-32d779b5de22b9ebe321a367a2a2749eef06103c.tar.xz
thermoprint-32d779b5de22b9ebe321a367a2a2749eef06103c.zip
Fixed tests for Printout.BBCode
Diffstat (limited to 'tp-bbcode')
-rw-r--r--tp-bbcode/test/Thermoprint/Printout/BBCodeSpec.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/tp-bbcode/test/Thermoprint/Printout/BBCodeSpec.hs b/tp-bbcode/test/Thermoprint/Printout/BBCodeSpec.hs
index c10018f..d2cdeed 100644
--- a/tp-bbcode/test/Thermoprint/Printout/BBCodeSpec.hs
+++ b/tp-bbcode/test/Thermoprint/Printout/BBCodeSpec.hs
@@ -19,7 +19,7 @@ import Control.Monad (zipWithM_)
19import Data.Monoid ((<>)) 19import Data.Monoid ((<>))
20import Data.Function (on) 20import Data.Function (on)
21 21
22import qualified Data.Sequence as Seq (fromList) 22import Data.Sequence (Seq)
23 23
24instance Eq Block where 24instance Eq Block where
25 (==) = (==) `on` cotext 25 (==) = (==) `on` cotext
@@ -35,10 +35,10 @@ spec = do
35 example n (s, ts) = let str = "Example " <> show n 35 example n (s, ts) = let str = "Example " <> show n
36 in specify str $ bbcode s == (pOut <$> ts) 36 in specify str $ bbcode s == (pOut <$> ts)
37 37
38pOut :: [Block] -> Printout 38pOut :: Seq Block -> Printout
39pOut = pure . Seq.fromList . map Cooked 39pOut = fmap (pure . Cooked)
40 40
41examples :: [(Text, Either BBCodeError [Block])] 41examples :: [(Text, Either BBCodeError (Seq Block))]
42examples = [ ("Hello World!" 42examples = [ ("Hello World!"
43 , Right [Line (JuxtaPos ["Hello", HSpace 1, "World!"])]) 43 , Right [Line (JuxtaPos ["Hello", HSpace 1, "World!"])])
44 , ("Hello [hspace width=2/] World!" 44 , ("Hello [hspace width=2/] World!"
@@ -46,5 +46,5 @@ examples = [ ("Hello World!"
46 , ("Par1\n\nPar2\n\nPar3 Word2" 46 , ("Par1\n\nPar2\n\nPar3 Word2"
47 , Right [Line ("Par1"), Line ("Par2"), Line (JuxtaPos ["Par3", HSpace 1, "Word2"])]) 47 , Right [Line ("Par1"), Line ("Par2"), Line (JuxtaPos ["Par3", HSpace 1, "Word2"])])
48 , ("Par1 [hspace=3/]\n\n[vspace=2/]Par2\n\nPar3 Word2" 48 , ("Par1 [hspace=3/]\n\n[vspace=2/]Par2\n\nPar3 Word2"
49 , Right [Line (JuxtaPos ["Par1", HSpace 4]), NewlSep [VSpace 1, Line ("Par2")], Line (JuxtaPos ["Par3", HSpace 1, "Word2"])]) 49 , Right [Line (JuxtaPos ["Par1", HSpace 4]), NewlSep [VSpace 2, Line ("Par2")], Line (JuxtaPos ["Par3", HSpace 1, "Word2"])])
50 ] 50 ]