diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-14 22:14:21 +0000 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-14 22:14:21 +0000 |
commit | 20105cc9a88d25a55eadf4263fc426a373ee0429 (patch) | |
tree | 97d9c816955769997308f6f87ae6c0a312666ca8 /bbcode | |
parent | 1cc1bc4555d1ca7688920027b401ea94f3b82d5f (diff) | |
download | thermoprint-20105cc9a88d25a55eadf4263fc426a373ee0429.tar thermoprint-20105cc9a88d25a55eadf4263fc426a373ee0429.tar.gz thermoprint-20105cc9a88d25a55eadf4263fc426a373ee0429.tar.bz2 thermoprint-20105cc9a88d25a55eadf4263fc426a373ee0429.tar.xz thermoprint-20105cc9a88d25a55eadf4263fc426a373ee0429.zip |
fixed tests for BBCode/Lexer.hs
Diffstat (limited to 'bbcode')
-rw-r--r-- | bbcode/test/Text/BBCode/LexerSpec.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bbcode/test/Text/BBCode/LexerSpec.hs b/bbcode/test/Text/BBCode/LexerSpec.hs index df96d52..e225fab 100644 --- a/bbcode/test/Text/BBCode/LexerSpec.hs +++ b/bbcode/test/Text/BBCode/LexerSpec.hs | |||
@@ -11,7 +11,7 @@ import Test.QuickCheck.Instances | |||
11 | import Text.BBCode.Lexer | 11 | import Text.BBCode.Lexer |
12 | 12 | ||
13 | import Data.Text (Text) | 13 | import Data.Text (Text) |
14 | import qualified Data.Text as T (singleton, replace, last, null) | 14 | import qualified Data.Text as T (singleton, replace, last, null, init) |
15 | 15 | ||
16 | import Data.Monoid ((<>), mconcat, Endo(..)) | 16 | import Data.Monoid ((<>), mconcat, Endo(..)) |
17 | import Data.List (intersperse) | 17 | import Data.List (intersperse) |
@@ -29,6 +29,7 @@ coToken (BBOpen t xs) = "[" <> escape [']'] t <> " " <> attrs <> " ]" | |||
29 | attrs = mconcat . intersperse " " $ map attr xs | 29 | attrs = mconcat . intersperse " " $ map attr xs |
30 | attr (key, "") = escape ['=', ']', ' '] key | 30 | attr (key, "") = escape ['=', ']', ' '] key |
31 | attr (key, val) = escape ['=', ']', ' '] key <> "=\"" <> escape ['\"'] val <> "\"" | 31 | attr (key, val) = escape ['=', ']', ' '] key <> "=\"" <> escape ['\"'] val <> "\"" |
32 | coToken (BBContained t xs) = (<> "/]") . T.init . coToken $ BBOpen t xs | ||
32 | coToken (BBClose t) = "[/" <> escape [']'] t <> "]" | 33 | coToken (BBClose t) = "[/" <> escape [']'] t <> "]" |
33 | coToken (BBStr t) = escape ['['] t | 34 | coToken (BBStr t) = escape ['['] t |
34 | 35 | ||