diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-18 05:42:26 +0000 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-18 05:42:26 +0000 |
commit | 4914e4d7f638b7771ecdaf24ee0516c05505697c (patch) | |
tree | 6c89d30ae2ea97f14f4a35af9013dc74e747492c /bbcode/test | |
parent | 539b69b3e3b0c4ffee2323a8fe6239ebda4af48c (diff) | |
download | thermoprint-4914e4d7f638b7771ecdaf24ee0516c05505697c.tar thermoprint-4914e4d7f638b7771ecdaf24ee0516c05505697c.tar.gz thermoprint-4914e4d7f638b7771ecdaf24ee0516c05505697c.tar.bz2 thermoprint-4914e4d7f638b7771ecdaf24ee0516c05505697c.tar.xz thermoprint-4914e4d7f638b7771ecdaf24ee0516c05505697c.zip |
Disallow paragraphs everywhere but at the top
Diffstat (limited to 'bbcode/test')
-rw-r--r-- | bbcode/test/Text/BBCodeSpec.hs | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/bbcode/test/Text/BBCodeSpec.hs b/bbcode/test/Text/BBCodeSpec.hs index e24c661..241cd76 100644 --- a/bbcode/test/Text/BBCodeSpec.hs +++ b/bbcode/test/Text/BBCodeSpec.hs | |||
@@ -20,44 +20,44 @@ spec = do | |||
20 | example n (s, ts) = let str = "Example " <> show n | 20 | example n (s, ts) = let str = "Example " <> show n |
21 | in specify str (bbcode s == Right ts) | 21 | in specify str (bbcode s == Right ts) |
22 | 22 | ||
23 | examples :: [(Text, [DomTree])] | 23 | examples :: [(Text, DomForest)] |
24 | examples = [ ("[t]test[/t]" | 24 | examples = [ ("[t]test[/t]" |
25 | , [Element "t" [] [Content "test"]]) | 25 | , pure [Element "t" [] [Content "test"]]) |
26 | , ("[t]te\\st[/t]" | 26 | , ("[t]te\\st[/t]" |
27 | , [Element "t" [] [Content "te\\st"]]) | 27 | , pure [Element "t" [] [Content "te\\st"]]) |
28 | , ("[t]te\\[st[/t]" | 28 | , ("[t]te\\[st[/t]" |
29 | , [Element "t" [] [Content "te[st"]]) | 29 | , pure [Element "t" [] [Content "te[st"]]) |
30 | , ("[t]test\\\\[/t]" | 30 | , ("[t]test\\\\[/t]" |
31 | , [Element "t" [] [Content "test\\"]]) | 31 | , pure [Element "t" [] [Content "test\\"]]) |
32 | , ("[\\t]test[/\\t]" | 32 | , ("[\\t]test[/\\t]" |
33 | , [Element "\\t" [] [Content "test"]]) | 33 | , pure [Element "\\t" [] [Content "test"]]) |
34 | , ("[t attr]test[/t]" | 34 | , ("[t attr]test[/t]" |
35 | , [Element "t" [("attr", "")] [Content "test"]]) | 35 | , pure [Element "t" [("attr", "")] [Content "test"]]) |
36 | , ("[t=attr]test[/t]" | 36 | , ("[t=attr]test[/t]" |
37 | , [Element "t" [("", "attr")] [Content "test"]]) | 37 | , pure [Element "t" [("", "attr")] [Content "test"]]) |
38 | , ("[t attr=val]test[/t]" | 38 | , ("[t attr=val]test[/t]" |
39 | , [Element "t" [("attr", "val")] [Content "test"]]) | 39 | , pure [Element "t" [("attr", "val")] [Content "test"]]) |
40 | , ("[t attr=\"val\"]test[/t]" | 40 | , ("[t attr=\"val\"]test[/t]" |
41 | , [Element "t" [("attr", "val")] [Content "test"]]) | 41 | , pure [Element "t" [("attr", "val")] [Content "test"]]) |
42 | , ("[t attr=\"va]l\"]test[/t]" | 42 | , ("[t attr=\"va]l\"]test[/t]" |
43 | , [Element "t" [("attr", "va]l")] [Content "test"]]) | 43 | , pure [Element "t" [("attr", "va]l")] [Content "test"]]) |
44 | , ("[t attr=\"va\\\"l\"]test[/t]" | 44 | , ("[t attr=\"va\\\"l\"]test[/t]" |
45 | , [Element "t" [("attr", "va\"l")] [Content "test"]]) | 45 | , pure [Element "t" [("attr", "va\"l")] [Content "test"]]) |
46 | , ("[t attr=\"val\" attr2=\"val2\" ]test[/t]" | 46 | , ("[t attr=\"val\" attr2=\"val2\" ]test[/t]" |
47 | , [Element "t" [("attr", "val"), ("attr2", "val2")] [Content "test"]]) | 47 | , pure [Element "t" [("attr", "val"), ("attr2", "val2")] [Content "test"]]) |
48 | , ("[br/]" | 48 | , ("[br/]" |
49 | , [Element "br" [] []]) | 49 | , pure [Element "br" [] []]) |
50 | , ("[br attr/]" | 50 | , ("[br attr/]" |
51 | , [Element "br" [("attr", "")] []]) | 51 | , pure [Element "br" [("attr", "")] []]) |
52 | , ("[br=val/]" | 52 | , ("[br=val/]" |
53 | , [Element "br" [("", "val")] []]) | 53 | , pure [Element "br" [("", "val")] []]) |
54 | , ("[br attr=val/]" | 54 | , ("[br attr=val/]" |
55 | , [Element "br" [("attr", "val")] []]) | 55 | , pure [Element "br" [("attr", "val")] []]) |
56 | , ("[br attr=val val2/]" | 56 | , ("[br attr=val val2/]" |
57 | , [Element "br" [("attr", "val"), ("val2", "")] []]) | 57 | , pure [Element "br" [("attr", "val"), ("val2", "")] []]) |
58 | , ("foo\n\nbar" | 58 | , ("foo\n\nbar" |
59 | , [Paragraph [Content "foo"], Paragraph [Content "bar"]]) | 59 | , [[Content "foo"], [Content "bar"]]) |
60 | , ("[b]foo\n\nbar[/b]" | 60 | , ("[b]foo[/b]\n\n[b]bar[/b]" |
61 | , [Element "b" [] [Paragraph [Content "foo"], Paragraph [Content "bar"]]]) | 61 | , [[Element "b" [] [Content "foo"]], [Element "b" [] [Content "bar"]]]) |
62 | ] | 62 | ] |
63 | 63 | ||