diff options
Diffstat (limited to 'test/Tests/Readers/Org/Block')
| -rw-r--r-- | test/Tests/Readers/Org/Block/CodeBlock.hs | 64 | ||||
| -rw-r--r-- | test/Tests/Readers/Org/Block/Figure.hs | 16 | ||||
| -rw-r--r-- | test/Tests/Readers/Org/Block/Header.hs | 6 | ||||
| -rw-r--r-- | test/Tests/Readers/Org/Block/Table.hs | 4 |
4 files changed, 45 insertions, 45 deletions
diff --git a/test/Tests/Readers/Org/Block/CodeBlock.hs b/test/Tests/Readers/Org/Block/CodeBlock.hs index 42ad09d86..adf6661ca 100644 --- a/test/Tests/Readers/Org/Block/CodeBlock.hs +++ b/test/Tests/Readers/Org/Block/CodeBlock.hs @@ -23,48 +23,48 @@ import qualified Data.Text as T tests :: [TestTree] tests = [ "Source block" =: - T.unlines [ " #+BEGIN_SRC haskell" + T.unlines [ " #+begin_src haskell" , " main = putStrLn greeting" , " where greeting = \"moin\"" - , " #+END_SRC" ] =?> + , " #+end_src" ] =?> let attr' = ("", ["haskell"], []) code' = "main = putStrLn greeting\n" <> " where greeting = \"moin\"\n" in codeBlockWith attr' code' , "Source block with indented code" =: - T.unlines [ " #+BEGIN_SRC haskell" + T.unlines [ " #+begin_src haskell" , " main = putStrLn greeting" , " where greeting = \"moin\"" - , " #+END_SRC" ] =?> + , " #+end_src" ] =?> let attr' = ("", ["haskell"], []) code' = "main = putStrLn greeting\n" <> " where greeting = \"moin\"\n" in codeBlockWith attr' code' , "Source block with tab-indented code" =: - T.unlines [ "\t#+BEGIN_SRC haskell" + T.unlines [ "\t#+begin_src haskell" , "\tmain = putStrLn greeting" , "\t where greeting = \"moin\"" - , "\t#+END_SRC" ] =?> + , "\t#+end_src" ] =?> let attr' = ("", ["haskell"], []) code' = "main = putStrLn greeting\n" <> " where greeting = \"moin\"\n" in codeBlockWith attr' code' , "Empty source block" =: - T.unlines [ " #+BEGIN_SRC haskell" - , " #+END_SRC" ] =?> + T.unlines [ " #+begin_src haskell" + , " #+end_src" ] =?> let attr' = ("", ["haskell"], []) code' = "" in codeBlockWith attr' code' , "Source block between paragraphs" =: T.unlines [ "Low German greeting" - , " #+BEGIN_SRC haskell" + , " #+begin_src haskell" , " main = putStrLn greeting" , " where greeting = \"Moin!\"" - , " #+END_SRC" ] =?> + , " #+end_src" ] =?> let attr' = ("", ["haskell"], []) code' = "main = putStrLn greeting\n" <> " where greeting = \"Moin!\"\n" @@ -72,10 +72,10 @@ tests = , codeBlockWith attr' code' ] , "Source block with babel arguments" =: - T.unlines [ "#+BEGIN_SRC emacs-lisp :exports both" + T.unlines [ "#+begin_src emacs-lisp :exports both" , "(progn (message \"Hello, World!\")" , " (+ 23 42))" - , "#+END_SRC" ] =?> + , "#+end_src" ] =?> let classes = [ "commonlisp" ] -- as kate doesn't know emacs-lisp syntax params = [ ("org-language", "emacs-lisp") , ("exports", "both") @@ -85,10 +85,10 @@ tests = in codeBlockWith ("", classes, params) code' , "Source block with results and :exports both" =: - T.unlines [ "#+BEGIN_SRC emacs-lisp :exports both" + T.unlines [ "#+begin_src emacs-lisp :exports both" , "(progn (message \"Hello, World!\")" , " (+ 23 42))" - , "#+END_SRC" + , "#+end_src" , "" , "#+RESULTS:" , ": 65"] =?> @@ -104,10 +104,10 @@ tests = codeBlockWith ("", ["example"], []) results' , "Source block with results and :exports code" =: - T.unlines [ "#+BEGIN_SRC emacs-lisp :exports code" + T.unlines [ "#+begin_src emacs-lisp :exports code" , "(progn (message \"Hello, World!\")" , " (+ 23 42))" - , "#+END_SRC" + , "#+end_src" , "" , "#+RESULTS:" , ": 65" ] =?> @@ -120,10 +120,10 @@ tests = in codeBlockWith ("", classes, params) code' , "Source block with results and :exports results" =: - T.unlines [ "#+BEGIN_SRC emacs-lisp :exports results" + T.unlines [ "#+begin_src emacs-lisp :exports results" , "(progn (message \"Hello, World!\")" , " (+ 23 42))" - , "#+END_SRC" + , "#+end_src" , "" , "#+RESULTS:" , ": 65" ] =?> @@ -131,37 +131,37 @@ tests = in codeBlockWith ("", ["example"], []) results' , "Source block with results and :exports none" =: - T.unlines [ "#+BEGIN_SRC emacs-lisp :exports none" + T.unlines [ "#+begin_src emacs-lisp :exports none" , "(progn (message \"Hello, World!\")" , " (+ 23 42))" - , "#+END_SRC" + , "#+end_src" , "" , "#+RESULTS:" , ": 65" ] =?> (mempty :: Blocks) , "Source block with toggling header arguments" =: - T.unlines [ "#+BEGIN_SRC sh :noeval" + T.unlines [ "#+begin_src sh :noeval" , "echo $HOME" - , "#+END_SRC" + , "#+end_src" ] =?> let classes = [ "bash" ] params = [ ("org-language", "sh"), ("noeval", "yes") ] in codeBlockWith ("", classes, params) "echo $HOME\n" , "Source block with line number switch" =: - T.unlines [ "#+BEGIN_SRC sh -n 10" + T.unlines [ "#+begin_src sh -n 10" , ":() { :|:& };:" - , "#+END_SRC" + , "#+end_src" ] =?> let classes = [ "bash", "numberLines" ] params = [ ("org-language", "sh"), ("startFrom", "10") ] in codeBlockWith ("", classes, params) ":() { :|:& };:\n" , "Source block with multi-word parameter values" =: - T.unlines [ "#+BEGIN_SRC dot :cmdline -Kdot -Tpng " + T.unlines [ "#+begin_src dot :cmdline -Kdot -Tpng " , "digraph { id [label=\"ID\"] }" - , "#+END_SRC" + , "#+end_src" ] =?> let classes = [ "dot" ] params = [ ("cmdline", "-Kdot -Tpng") ] @@ -177,12 +177,12 @@ tests = "A chosen representation of\na rule.\n" , "Code block with caption" =: - T.unlines [ "#+CAPTION: Functor laws in Haskell" - , "#+NAME: functor-laws" - , "#+BEGIN_SRC haskell" + T.unlines [ "#+caption: Functor laws in Haskell" + , "#+name: functor-laws" + , "#+begin_src haskell" , "fmap id = id" , "fmap (p . q) = (fmap p) . (fmap q)" - , "#+END_SRC" + , "#+end_src" ] =?> divWith nullAttr @@ -195,9 +195,9 @@ tests = ]))) , "Non-letter chars in source block parameters" =: - T.unlines [ "#+BEGIN_SRC C :tangle xxxx.c :city Zürich" + T.unlines [ "#+begin_src C :tangle xxxx.c :city Zürich" , "code body" - , "#+END_SRC" + , "#+end_src" ] =?> let params = [ ("org-language", "C") , ("tangle", "xxxx.c") diff --git a/test/Tests/Readers/Org/Block/Figure.hs b/test/Tests/Readers/Org/Block/Figure.hs index 829ef0496..56ddde9d8 100644 --- a/test/Tests/Readers/Org/Block/Figure.hs +++ b/test/Tests/Readers/Org/Block/Figure.hs @@ -44,9 +44,9 @@ tests = "Used as a metapher in evolutionary biology.") , "Figure with HTML attributes" =: - T.unlines [ "#+CAPTION: mah brain just explodid" - , "#+NAME: lambdacat" - , "#+ATTR_HTML: :style color: blue :role button" + T.unlines [ "#+caption: mah brain just explodid" + , "#+name: lambdacat" + , "#+attr_html: :style color: blue :role button" , "[[file:lambdacat.jpg]]" ] =?> let kv = [("style", "color: blue"), ("role", "button")] @@ -55,22 +55,22 @@ tests = in para (imageWith (mempty, mempty, kv) "lambdacat.jpg" name caption) , "LaTeX attributes are ignored" =: - T.unlines [ "#+CAPTION: Attribute after caption" - , "#+ATTR_LATEX: :float nil" + T.unlines [ "#+caption: Attribute after caption" + , "#+attr_latex: :float nil" , "[[file:test.png]]" ] =?> para (image "test.png" "fig:" "Attribute after caption") , "Labelled figure" =: - T.unlines [ "#+CAPTION: My figure" - , "#+LABEL: fig:myfig" + T.unlines [ "#+caption: My figure" + , "#+label: fig:myfig" , "[[file:blub.png]]" ] =?> let attr = ("fig:myfig", mempty, mempty) in para (imageWith attr "blub.png" "fig:" "My figure") , "Figure with empty caption" =: - T.unlines [ "#+CAPTION:" + T.unlines [ "#+caption:" , "[[file:guess.jpg]]" ] =?> para (image "guess.jpg" "fig:" "") diff --git a/test/Tests/Readers/Org/Block/Header.hs b/test/Tests/Readers/Org/Block/Header.hs index 31056b5b5..d38d26efb 100644 --- a/test/Tests/Readers/Org/Block/Header.hs +++ b/test/Tests/Readers/Org/Block/Header.hs @@ -99,7 +99,7 @@ tests = headerWith ("waiting-header", [], []) 1 "WAITING header" , "Custom todo keywords" =: - T.unlines [ "#+TODO: WAITING CANCELLED" + T.unlines [ "#+todo: WAITING CANCELLED" , "* WAITING compile" , "* CANCELLED lunch" ] =?> @@ -109,7 +109,7 @@ tests = <> headerWith ("lunch", [], []) 1 (doneSpan <> space <> "lunch") , "Custom todo keywords with multiple done-states" =: - T.unlines [ "#+TODO: WAITING | DONE CANCELLED " + T.unlines [ "#+todo: WAITING | DONE CANCELLED " , "* WAITING compile" , "* CANCELLED lunch" , "* DONE todo-feature" @@ -248,7 +248,7 @@ tests = headerWith ("look", [], []) 1 "important" , "third and forth level headers" =: - T.unlines [ "#+OPTIONS: p:t h:3" + T.unlines [ "#+options: p:t h:3" , "*** Third" , " CLOSED: [2018-09-05 Wed 13:58]" , " Text 3" diff --git a/test/Tests/Readers/Org/Block/Table.hs b/test/Tests/Readers/Org/Block/Table.hs index ab404648e..31c994d3f 100644 --- a/test/Tests/Readers/Org/Block/Table.hs +++ b/test/Tests/Readers/Org/Block/Table.hs @@ -167,7 +167,7 @@ tests = ] , "Table with caption" =: - T.unlines [ "#+CAPTION: Hitchhiker's Multiplication Table" + T.unlines [ "#+caption: Hitchhiker's Multiplication Table" , "| x | 6 |" , "| 9 | 42 |" ] =?> @@ -180,7 +180,7 @@ tests = ] , "named table" =: - T.unlines [ "#+NAME: x-marks-the-spot" + T.unlines [ "#+name: x-marks-the-spot" , "| x |" ] =?> divWith ("x-marks-the-spot", mempty, mempty) |
