diff options
Diffstat (limited to 'test/Tests/Readers/Org')
-rw-r--r-- | test/Tests/Readers/Org/Block/Header.hs | 38 | ||||
-rw-r--r-- | test/Tests/Readers/Org/Block/List.hs | 11 | ||||
-rw-r--r-- | test/Tests/Readers/Org/Directive.hs | 23 | ||||
-rw-r--r-- | test/Tests/Readers/Org/Inline.hs | 9 |
4 files changed, 80 insertions, 1 deletions
diff --git a/test/Tests/Readers/Org/Block/Header.hs b/test/Tests/Readers/Org/Block/Header.hs index 3b0d7dda9..913c830d6 100644 --- a/test/Tests/Readers/Org/Block/Header.hs +++ b/test/Tests/Readers/Org/Block/Header.hs @@ -181,4 +181,42 @@ tests = , " :END:" ] =?> headerWith ("not-numbered", ["unnumbered"], []) 1 "Not numbered" + + , testGroup "planning information" + [ "Planning info is not included in output" =: + T.unlines [ "* important" + , T.unwords + [ "CLOSED: [2018-09-05 Wed 13:58]" + , "DEADLINE: <2018-09-17 Mon>" + , "SCHEDULED: <2018-09-10 Mon>" + ] + ] =?> + headerWith ("important", [], []) 1 "important" + + , "Properties after planning info are recognized" =: + T.unlines [ "* important " + , " " <> T.unwords + [ "CLOSED: [2018-09-05 Wed 13:58]" + , "DEADLINE: <2018-09-17 Mon>" + , "SCHEDULED: <2018-09-10 Mon>" + ] + , " :PROPERTIES:" + , " :custom_id: look" + , " :END:" + ] =?> + headerWith ("look", [], []) 1 "important" + + , "Planning info followed by test" =: + T.unlines [ "* important " + , " " <> T.unwords + [ "CLOSED: [2018-09-05 Wed 13:58]" + , "DEADLINE: <2018-09-17 Mon>" + , "SCHEDULED: <2018-09-10 Mon>" + ] + , " :PROPERTIES:" + , " :custom_id: look" + , " :END:" + ] =?> + headerWith ("look", [], []) 1 "important" + ] ] diff --git a/test/Tests/Readers/Org/Block/List.hs b/test/Tests/Readers/Org/Block/List.hs index f273b684d..bdab01404 100644 --- a/test/Tests/Readers/Org/Block/List.hs +++ b/test/Tests/Readers/Org/Block/List.hs @@ -243,4 +243,15 @@ tests = mconcat [ para "CLOSED: [2015-10-19 Mon 15:03]" , bulletList [ plain "Note taken on [2015-10-19 Mon 13:24]" ] ] + + , "Markup after header and list" =: + T.unlines [ "* headline" + , "- list" + , "" + , "~variable name~" + ] =?> + mconcat [ headerWith ("headline", [], []) 1 "headline" + , bulletList [ plain "list" ] + , para (code "variable name") + ] ] diff --git a/test/Tests/Readers/Org/Directive.hs b/test/Tests/Readers/Org/Directive.hs index bb9c52e69..87abb714d 100644 --- a/test/Tests/Readers/Org/Directive.hs +++ b/test/Tests/Readers/Org/Directive.hs @@ -150,6 +150,29 @@ tests = , "* Headline :hello:world:" ] =?> headerWith ("headline", [], mempty) 1 "Headline" + + , testGroup "planning information" + [ "include planning info after headlines" =: + T.unlines [ "#+OPTIONS: p:t" + , "* important" + , " DEADLINE: <2018-10-01 Mon> SCHEDULED: <2018-09-15 Sat>" + ] =?> + mconcat [ headerWith ("important", mempty, mempty) 1 "important" + , plain $ strong "DEADLINE:" + <> space + <> emph (str "<2018-10-01 Mon>") + <> space + <> strong "SCHEDULED:" + <> space + <> emph (str "<2018-09-15 Sat>") + ] + + , "empty planning info is not included" =: + T.unlines [ "#+OPTIONS: p:t" + , "* Wichtig" + ] =?> + headerWith ("wichtig", mempty, mempty) 1 "Wichtig" + ] ] , testGroup "Include" diff --git a/test/Tests/Readers/Org/Inline.hs b/test/Tests/Readers/Org/Inline.hs index 07fe2d2e9..9cfcda79f 100644 --- a/test/Tests/Readers/Org/Inline.hs +++ b/test/Tests/Readers/Org/Inline.hs @@ -96,7 +96,7 @@ tests = "[fn::Schreib mir eine E-Mail]" =?> para (note $ para "Schreib mir eine E-Mail") - , "Markup-chars not occuring on word break are symbols" =: + , "Markup-chars not occurring on word break are symbols" =: T.unlines [ "this+that+ +so+on" , "seven*eight* nine*" , "+not+funny+" @@ -280,6 +280,13 @@ tests = ) "echo 'Hello, World'") + , "Inline code block with a blank argument array" =: + "src_sh[]{echo 'Hello, World'}" =?> + para (codeWith ( "" + , [ "bash" ] + , [ ("org-language", "sh") ]) + "echo 'Hello, World'") + , "Inline code block with toggle" =: "src_sh[:toggle]{echo $HOME}" =?> para (codeWith ( "" |