@@ -23,48 +23,48 @@ import qualified Data.Text as T
23tests :: [TestTree]
23tests :: [TestTree]
25 [ "Source block" =:
25 [ "Source block" =:
26− T.unlines [ " #+BEGIN_SRC haskell"
26+ T.unlines [ " #+begin_src haskell"
27 , " main = putStrLn greeting"
27 , " main = putStrLn greeting"
28 , " where greeting = \"moin\""
28 , " where greeting = \"moin\""
29− , " #+END_SRC" ] =?>
29+ , " #+end_src" ] =?>
30 let attr' = ("", ["haskell"], [])
30 let attr' = ("", ["haskell"], [])
31 code' = "main = putStrLn greeting\n" <>
31 code' = "main = putStrLn greeting\n" <>
32 " where greeting = \"moin\"\n"
32 " where greeting = \"moin\"\n"
33 in codeBlockWith attr' code'
33 in codeBlockWith attr' code'
35 , "Source block with indented code" =:
35 , "Source block with indented code" =:
36− T.unlines [ " #+BEGIN_SRC haskell"
36+ T.unlines [ " #+begin_src haskell"
37 , " main = putStrLn greeting"
37 , " main = putStrLn greeting"
38 , " where greeting = \"moin\""
38 , " where greeting = \"moin\""
39− , " #+END_SRC" ] =?>
39+ , " #+end_src" ] =?>
40 let attr' = ("", ["haskell"], [])
40 let attr' = ("", ["haskell"], [])
41 code' = "main = putStrLn greeting\n" <>
41 code' = "main = putStrLn greeting\n" <>
42 " where greeting = \"moin\"\n"
42 " where greeting = \"moin\"\n"
43 in codeBlockWith attr' code'
43 in codeBlockWith attr' code'
45 , "Source block with tab-indented code" =:
45 , "Source block with tab-indented code" =:
46− T.unlines [ "\t#+BEGIN_SRC haskell"
46+ T.unlines [ "\t#+begin_src haskell"
47 , "\tmain = putStrLn greeting"
47 , "\tmain = putStrLn greeting"
48 , "\t where greeting = \"moin\""
48 , "\t where greeting = \"moin\""
49− , "\t#+END_SRC" ] =?>
49+ , "\t#+end_src" ] =?>
50 let attr' = ("", ["haskell"], [])
50 let attr' = ("", ["haskell"], [])
51 code' = "main = putStrLn greeting\n" <>
51 code' = "main = putStrLn greeting\n" <>
52 " where greeting = \"moin\"\n"
52 " where greeting = \"moin\"\n"
53 in codeBlockWith attr' code'
53 in codeBlockWith attr' code'
55 , "Empty source block" =:
55 , "Empty source block" =:
56− T.unlines [ " #+BEGIN_SRC haskell"
56+ T.unlines [ " #+begin_src haskell"
57− , " #+END_SRC" ] =?>
57+ , " #+end_src" ] =?>
58 let attr' = ("", ["haskell"], [])
58 let attr' = ("", ["haskell"], [])
59 code' = ""
59 code' = ""
60 in codeBlockWith attr' code'
60 in codeBlockWith attr' code'
62 , "Source block between paragraphs" =:
62 , "Source block between paragraphs" =:
63 T.unlines [ "Low German greeting"
63 T.unlines [ "Low German greeting"
64− , " #+BEGIN_SRC haskell"
64+ , " #+begin_src haskell"
65 , " main = putStrLn greeting"
65 , " main = putStrLn greeting"
66 , " where greeting = \"Moin!\""
66 , " where greeting = \"Moin!\""
67− , " #+END_SRC" ] =?>
67+ , " #+end_src" ] =?>
68 let attr' = ("", ["haskell"], [])
68 let attr' = ("", ["haskell"], [])
69 code' = "main = putStrLn greeting\n" <>
69 code' = "main = putStrLn greeting\n" <>
70 " where greeting = \"Moin!\"\n"
70 " where greeting = \"Moin!\"\n"
@@ -72,10 +72,10 @@ tests =
72 , codeBlockWith attr' code'
72 , codeBlockWith attr' code'
74 , "Source block with babel arguments" =:
74 , "Source block with babel arguments" =:
75− T.unlines [ "#+BEGIN_SRC emacs-lisp :exports both"
75+ T.unlines [ "#+begin_src emacs-lisp :exports both"
76 , "(progn (message \"Hello, World!\")"
76 , "(progn (message \"Hello, World!\")"
77 , " (+ 23 42))"
77 , " (+ 23 42))"
78− , "#+END_SRC" ] =?>
78+ , "#+end_src" ] =?>
79 let classes = [ "commonlisp" ] -- as kate doesn't know emacs-lisp syntax
79 let classes = [ "commonlisp" ] -- as kate doesn't know emacs-lisp syntax
80 params = [ ("org-language", "emacs-lisp")
80 params = [ ("org-language", "emacs-lisp")
81 , ("exports", "both")
81 , ("exports", "both")
@@ -85,10 +85,10 @@ tests =
85 in codeBlockWith ("", classes, params) code'
85 in codeBlockWith ("", classes, params) code'
87 , "Source block with results and :exports both" =:
87 , "Source block with results and :exports both" =:
88− T.unlines [ "#+BEGIN_SRC emacs-lisp :exports both"
88+ T.unlines [ "#+begin_src emacs-lisp :exports both"
89 , "(progn (message \"Hello, World!\")"
89 , "(progn (message \"Hello, World!\")"
90 , " (+ 23 42))"
90 , " (+ 23 42))"
91− , "#+END_SRC"
91+ , "#+end_src"
93 , "#+RESULTS:"
93 , "#+RESULTS:"
94 , ": 65"] =?>
94 , ": 65"] =?>
@@ -104,10 +104,10 @@ tests =
104 codeBlockWith ("", ["example"], []) results'
104 codeBlockWith ("", ["example"], []) results'
106 , "Source block with results and :exports code" =:
106 , "Source block with results and :exports code" =:
107− T.unlines [ "#+BEGIN_SRC emacs-lisp :exports code"
107+ T.unlines [ "#+begin_src emacs-lisp :exports code"
108 , "(progn (message \"Hello, World!\")"
108 , "(progn (message \"Hello, World!\")"
109 , " (+ 23 42))"
109 , " (+ 23 42))"
110− , "#+END_SRC"
110+ , "#+end_src"
112 , "#+RESULTS:"
112 , "#+RESULTS:"
113 , ": 65" ] =?>
113 , ": 65" ] =?>
@@ -120,10 +120,10 @@ tests =
120 in codeBlockWith ("", classes, params) code'
120 in codeBlockWith ("", classes, params) code'
122 , "Source block with results and :exports results" =:
122 , "Source block with results and :exports results" =:
123− T.unlines [ "#+BEGIN_SRC emacs-lisp :exports results"
123+ T.unlines [ "#+begin_src emacs-lisp :exports results"
124 , "(progn (message \"Hello, World!\")"
124 , "(progn (message \"Hello, World!\")"
125 , " (+ 23 42))"
125 , " (+ 23 42))"
126− , "#+END_SRC"
126+ , "#+end_src"
128 , "#+RESULTS:"
128 , "#+RESULTS:"
129 , ": 65" ] =?>
129 , ": 65" ] =?>
@@ -131,37 +131,37 @@ tests =
131 in codeBlockWith ("", ["example"], []) results'
131 in codeBlockWith ("", ["example"], []) results'
133 , "Source block with results and :exports none" =:
133 , "Source block with results and :exports none" =:
134− T.unlines [ "#+BEGIN_SRC emacs-lisp :exports none"
134+ T.unlines [ "#+begin_src emacs-lisp :exports none"
135 , "(progn (message \"Hello, World!\")"
135 , "(progn (message \"Hello, World!\")"
136 , " (+ 23 42))"
136 , " (+ 23 42))"
137− , "#+END_SRC"
137+ , "#+end_src"
139 , "#+RESULTS:"
139 , "#+RESULTS:"
140 , ": 65" ] =?>
140 , ": 65" ] =?>
141 (mempty :: Blocks)
141 (mempty :: Blocks)
143 , "Source block with toggling header arguments" =:
143 , "Source block with toggling header arguments" =:
144− T.unlines [ "#+BEGIN_SRC sh :noeval"
144+ T.unlines [ "#+begin_src sh :noeval"
145 , "echo $HOME"
145 , "echo $HOME"
146− , "#+END_SRC"
146+ , "#+end_src"
148 let classes = [ "bash" ]
148 let classes = [ "bash" ]
149 params = [ ("org-language", "sh"), ("noeval", "yes") ]
149 params = [ ("org-language", "sh"), ("noeval", "yes") ]
150 in codeBlockWith ("", classes, params) "echo $HOME\n"
150 in codeBlockWith ("", classes, params) "echo $HOME\n"
152 , "Source block with line number switch" =:
152 , "Source block with line number switch" =:
153− T.unlines [ "#+BEGIN_SRC sh -n 10"
153+ T.unlines [ "#+begin_src sh -n 10"
154 , ":() { :|:& };:"
154 , ":() { :|:& };:"
155− , "#+END_SRC"
155+ , "#+end_src"
157 let classes = [ "bash", "numberLines" ]
157 let classes = [ "bash", "numberLines" ]
158 params = [ ("org-language", "sh"), ("startFrom", "10") ]
158 params = [ ("org-language", "sh"), ("startFrom", "10") ]
159 in codeBlockWith ("", classes, params) ":() { :|:& };:\n"
159 in codeBlockWith ("", classes, params) ":() { :|:& };:\n"
161 , "Source block with multi-word parameter values" =:
161 , "Source block with multi-word parameter values" =:
162− T.unlines [ "#+BEGIN_SRC dot :cmdline -Kdot -Tpng "
162+ T.unlines [ "#+begin_src dot :cmdline -Kdot -Tpng "
163 , "digraph { id [label=\"ID\"] }"
163 , "digraph { id [label=\"ID\"] }"
164− , "#+END_SRC"
164+ , "#+end_src"
166 let classes = [ "dot" ]
166 let classes = [ "dot" ]
167 params = [ ("cmdline", "-Kdot -Tpng") ]
167 params = [ ("cmdline", "-Kdot -Tpng") ]
@@ -177,12 +177,12 @@ tests =
177 "A chosen representation of\na rule.\n"
177 "A chosen representation of\na rule.\n"
179 , "Code block with caption" =:
179 , "Code block with caption" =:
180− T.unlines [ "#+CAPTION: Functor laws in Haskell"
180+ T.unlines [ "#+caption: Functor laws in Haskell"
181− , "#+NAME: functor-laws"
181+ , "#+name: functor-laws"
182− , "#+BEGIN_SRC haskell"
182+ , "#+begin_src haskell"
183 , "fmap id = id"
183 , "fmap id = id"
184 , "fmap (p . q) = (fmap p) . (fmap q)"
184 , "fmap (p . q) = (fmap p) . (fmap q)"
185− , "#+END_SRC"
185+ , "#+end_src"
@@ -195,9 +195,9 @@ tests =
197 , "Non-letter chars in source block parameters" =:
197 , "Non-letter chars in source block parameters" =:
198− T.unlines [ "#+BEGIN_SRC C :tangle xxxx.c :city Zürich"
198+ T.unlines [ "#+begin_src C :tangle xxxx.c :city Zürich"
199 , "code body"
199 , "code body"
200− , "#+END_SRC"
200+ , "#+end_src"
202 let params = [ ("org-language", "C")
202 let params = [ ("org-language", "C")
203 , ("tangle", "xxxx.c")
203 , ("tangle", "xxxx.c")