diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-19 17:29:36 +0000 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-19 17:29:36 +0000 |
| commit | 32d779b5de22b9ebe321a367a2a2749eef06103c (patch) | |
| tree | e9950c3a57254de7d91d17eceeebc8b2d328ef8e | |
| parent | a1dbc24787c9da9d8219446444a2957a332090d9 (diff) | |
| download | thermoprint-32d779b5de22b9ebe321a367a2a2749eef06103c.tar thermoprint-32d779b5de22b9ebe321a367a2a2749eef06103c.tar.gz thermoprint-32d779b5de22b9ebe321a367a2a2749eef06103c.tar.bz2 thermoprint-32d779b5de22b9ebe321a367a2a2749eef06103c.tar.xz thermoprint-32d779b5de22b9ebe321a367a2a2749eef06103c.zip | |
Fixed tests for Printout.BBCode
| -rw-r--r-- | tp-bbcode/test/Thermoprint/Printout/BBCodeSpec.hs | 10 |
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_) | |||
| 19 | import Data.Monoid ((<>)) | 19 | import Data.Monoid ((<>)) |
| 20 | import Data.Function (on) | 20 | import Data.Function (on) |
| 21 | 21 | ||
| 22 | import qualified Data.Sequence as Seq (fromList) | 22 | import Data.Sequence (Seq) |
| 23 | 23 | ||
| 24 | instance Eq Block where | 24 | instance 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 | ||
| 38 | pOut :: [Block] -> Printout | 38 | pOut :: Seq Block -> Printout |
| 39 | pOut = pure . Seq.fromList . map Cooked | 39 | pOut = fmap (pure . Cooked) |
| 40 | 40 | ||
| 41 | examples :: [(Text, Either BBCodeError [Block])] | 41 | examples :: [(Text, Either BBCodeError (Seq Block))] |
| 42 | examples = [ ("Hello World!" | 42 | examples = [ ("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 | ] |
