@@ -363,29 +363,6 @@ tests =
363363 , "#+END_COMMENT"] =?>
364364 (mempty::Blocks)
365365
366− , "Source Block in Text" =:
367− unlines [ "Low German greeting"
368− , " #+BEGIN_SRC haskell"
369− , " main = putStrLn greeting"
370− , " where greeting = \"moin\""
371− , " #+END_SRC" ] =?>
372− let attr' = ("", ["haskell"], [])
373− code' = "main = putStrLn greeting\n" ++
374− " where greeting = \"moin\"\n"
375− in mconcat [ para $ spcSep [ "Low", "German", "greeting" ]
376− , codeBlockWith attr' code'
377− ]
378−
379− , "Source Block" =:
380− unlines [ " #+BEGIN_SRC haskell"
381− , " main = putStrLn greeting"
382− , " where greeting = \"moin\""
383− , " #+END_SRC" ] =?>
384− let attr' = ("", ["haskell"], [])
385− code' = "main = putStrLn greeting\n" ++
386− " where greeting = \"moin\"\n"
387− in codeBlockWith attr' code'
388−
389366 , "Figure" =:
390367 unlines [ "#+caption: A very courageous man."
391368 , "#+name: goodguy"
@@ -661,4 +638,78 @@ tests =
661638 , [ plain "2" , plain mempty , plain mempty ]
662639 ]
663640 ]
641+
642+ , testGroup "Blocks"
643+ [ "Source block" =:
644+ unlines [ " #+BEGIN_SRC haskell"
645+ , " main = putStrLn greeting"
646+ , " where greeting = \"moin\""
647+ , " #+END_SRC" ] =?>
648+ let attr' = ("", ["haskell"], [])
649+ code' = "main = putStrLn greeting\n" ++
650+ " where greeting = \"moin\"\n"
651+ in codeBlockWith attr' code'
652+
653+ , "Source block between paragraphs" =:
654+ unlines [ "Low German greeting"
655+ , " #+BEGIN_SRC haskell"
656+ , " main = putStrLn greeting"
657+ , " where greeting = \"Moin!\""
658+ , " #+END_SRC" ] =?>
659+ let attr' = ("", ["haskell"], [])
660+ code' = "main = putStrLn greeting\n" ++
661+ " where greeting = \"Moin!\"\n"
662+ in mconcat [ para $ spcSep [ "Low", "German", "greeting" ]
663+ , codeBlockWith attr' code'
664+ ]
665+
666+ , "Example block" =:
667+ unlines [ "#+begin_example"
668+ , "A chosen representation of"
669+ , "a rule."
670+ , "#+eND_exAMPle"
671+ ] =?>
672+ codeBlockWith ("", ["example"], [])
673+ "A chosen representation of\na rule.\n"
674+
675+ , "HTML block" =:
676+ unlines [ "#+BEGIN_HTML"
677+ , "<aside>HTML5 is pretty nice.</aside>"
678+ , "#+END_HTML"
679+ ] =?>
680+ rawBlock "html" "<aside>HTML5 is pretty nice.</aside>\n"
681+
682+ , "Quote block" =:
683+ unlines [ "#+BEGIN_QUOTE"
684+ , "/Niemand/ hat die Absicht, eine Mauer zu errichten!"
685+ , "#+END_QUOTE"
686+ ] =?>
687+ blockQuote (para (spcSep [ emph "Niemand", "hat", "die", "Absicht,"
688+ , "eine", "Mauer", "zu", "errichten!"
689+ ]))
690+
691+ , "Verse block" =:
692+ unlines [ "The first lines of Goethe's /Faust/:"
693+ , "#+begin_verse"
694+ , "Habe nun, ach! Philosophie,"
695+ , "Juristerei und Medizin,"
696+ , "Und leider auch Theologie!"
697+ , "Durchaus studiert, mit heißem Bemühn."
698+ , "#+end_verse"
699+ ] =?>
700+ mconcat
701+ [ para $ spcSep [ "The", "first", "lines", "of"
702+ , "Goethe's", emph "Faust" <> ":"]
703+ , para $ mconcat
704+ [ spcSep [ "Habe", "nun,", "ach!", "Philosophie," ]
705+ , linebreak
706+ , spcSep [ "Juristerei", "und", "Medizin," ]
707+ , linebreak
708+ , spcSep [ "Und", "leider", "auch", "Theologie!" ]
709+ , linebreak
710+ , spcSep [ "Durchaus", "studiert,", "mit", "heißem", "Bemühn." ]
711+ ]
712+ ]
713+
714+ ]
664715 ]