summaryrefslogtreecommitdiff
path: root/tests/Tests
diff options
context:
space:
mode:
authorAlbert Krewinkel <tarleb@moltkeplatz.de>2014-04-08 22:39:25 +0200
committerAlbert Krewinkel <tarleb@moltkeplatz.de>2014-04-09 15:26:06 +0200
commit030020236c85c736892a6f8e0dcefca1681e5ce0 (patch)
treed547e6f97d1a9dfa819b410ffc837f51e49700f6 /tests/Tests
parentbfd598e1e93d9a15c8b69c167c5d0e5dd1503017 (diff)
Org reader: Precise rules for the recognition of markup
The inline parsers have been rewritten using the org source code as a reference. This fixes a couple of bugs related to erroneous markup recognition.
Diffstat (limited to 'tests/Tests')
-rw-r--r--tests/Tests/Readers/Org.hs25
1 files changed, 23 insertions, 2 deletions
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs
index 77b9d9327..efd8fe977 100644
--- a/tests/Tests/Readers/Org.hs
+++ b/tests/Tests/Readers/Org.hs
@@ -86,16 +86,37 @@ tests =
unlines [ "this+that+ +so+on"
, "seven*eight* nine*"
, "+not+funny+"
+ , "this == self"
] =?>
para (spcSep [ "this+that+", "+so+on"
, "seven*eight*", "nine*"
, strikeout "not+funny"
+ , "this" <> space <> "==" <> space <> "self"
])
+ , "Adherence to Org's rules for markup borders" =:
+ "/t/& a/ / ./r/ (*l*) /e/! /b/." =?>
+ para (spcSep [ emph $ "t/&" <> space <> "a"
+ , "/"
+ , "./r/"
+ , "(" <> (strong "l") <> ")"
+ , (emph "e") <> "!"
+ , (emph "b") <> "."
+ ])
+
+ , "Inline math must stay within three lines" =:
+ unlines [ "$a", "b", "c$", "$d", "e", "f", "g$" ] =?>
+ para ((math "a\nb\nc") <> space <>
+ spcSep [ "$d", "e", "f", "g$" ])
+
, "Markup may not span more than two lines" =:
- unlines [ "/this *is", "not*", "emph/" ] =?>
+ unlines [ "/this *is +totally", "nice+ not*", "emph/" ] =?>
para (spcSep [ "/this"
- , (strong ("is" <> space <> "not"))
+ , (strong (spcSep
+ [ "is"
+ , (strikeout ("totally" <> space <> "nice"))
+ , "not"
+ ]))
, "emph/" ])
, "Image" =: