diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-01-19 21:25:24 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-01-19 21:25:24 -0800 |
commit | b8ffd834cff717fe424f22e506351f2ecec4655a (patch) | |
tree | 70359c33066bebf2ec4c54c1c2d78f38b49c0fb8 /test/Tests/Writers | |
parent | 8b3707de0402165b5691f626370203fa8982a5dc (diff) |
hlint code improvements.
Diffstat (limited to 'test/Tests/Writers')
-rw-r--r-- | test/Tests/Writers/ConTeXt.hs | 7 | ||||
-rw-r--r-- | test/Tests/Writers/Docbook.hs | 2 | ||||
-rw-r--r-- | test/Tests/Writers/FB2.hs | 2 | ||||
-rw-r--r-- | test/Tests/Writers/JATS.hs | 2 | ||||
-rw-r--r-- | test/Tests/Writers/Markdown.hs | 42 | ||||
-rw-r--r-- | test/Tests/Writers/Native.hs | 2 | ||||
-rw-r--r-- | test/Tests/Writers/Powerpoint.hs | 12 | ||||
-rw-r--r-- | test/Tests/Writers/TEI.hs | 2 |
8 files changed, 34 insertions, 37 deletions
diff --git a/test/Tests/Writers/ConTeXt.hs b/test/Tests/Writers/ConTeXt.hs index 7145240e3..5ce629674 100644 --- a/test/Tests/Writers/ConTeXt.hs +++ b/test/Tests/Writers/ConTeXt.hs @@ -41,9 +41,9 @@ tests = [ testGroup "inline code" , "without '}'" =: code "]" =?> "\\type{]}" , testProperty "code property" $ \s -> null s || if '{' `elem` s || '}' `elem` s - then (context' $ code s) == "\\mono{" ++ - (context' $ str s) ++ "}" - else (context' $ code s) == "\\type{" ++ s ++ "}" + then context' (code s) == "\\mono{" ++ + context' (str s) ++ "}" + else context' (code s) == "\\type{" ++ s ++ "}" ] , testGroup "headers" [ "level 1" =: @@ -124,4 +124,3 @@ tests = [ testGroup "inline code" , "\\stopplacetable" ] ] ] - diff --git a/test/Tests/Writers/Docbook.hs b/test/Tests/Writers/Docbook.hs index 90ae073fa..89ea76586 100644 --- a/test/Tests/Writers/Docbook.hs +++ b/test/Tests/Writers/Docbook.hs @@ -230,7 +230,7 @@ tests = [ testGroup "line blocks" ] ] ] - , testGroup "writer options" $ + , testGroup "writer options" [ testGroup "top-level division" $ let headers = header 1 (text "header1") diff --git a/test/Tests/Writers/FB2.hs b/test/Tests/Writers/FB2.hs index b4d11abf4..6663c42f8 100644 --- a/test/Tests/Writers/FB2.hs +++ b/test/Tests/Writers/FB2.hs @@ -23,7 +23,7 @@ tests = [ testGroup "block elements" ] , testGroup "inlines" [ - "Emphasis" =: emph ("emphasized") + "Emphasis" =: emph "emphasized" =?> fb2 "<emphasis>emphasized</emphasis>" ] , "bullet list" =: bulletList [ plain $ text "first" diff --git a/test/Tests/Writers/JATS.hs b/test/Tests/Writers/JATS.hs index f14f1c229..572b16451 100644 --- a/test/Tests/Writers/JATS.hs +++ b/test/Tests/Writers/JATS.hs @@ -120,5 +120,3 @@ tests = [ testGroup "inline code" \</sec>" ] ] - - diff --git a/test/Tests/Writers/Markdown.hs b/test/Tests/Writers/Markdown.hs index 012e0888c..7f9ac3627 100644 --- a/test/Tests/Writers/Markdown.hs +++ b/test/Tests/Writers/Markdown.hs @@ -80,7 +80,7 @@ noteTestDoc = ".") <> blockQuote (para ("A note inside a block quote." <> note (para "The second note.")) <> - para ("A second paragraph.")) <> + para "A second paragraph.") <> header 1 "Second Header" <> para "Some more text." @@ -91,7 +91,7 @@ noteTests = testGroup "note and reference location" [ test (markdownWithOpts defopts) "footnotes at the end of a document" $ noteTestDoc =?> - (unlines $ [ "First Header" + (unlines [ "First Header" , "============" , "" , "This is a footnote.[^1] And this is a [link](https://www.google.com)." @@ -112,7 +112,7 @@ noteTests = testGroup "note and reference location" , test (markdownWithOpts defopts{writerReferenceLocation=EndOfBlock}) "footnotes at the end of blocks" $ noteTestDoc =?> - (unlines $ [ "First Header" + (unlines [ "First Header" , "============" , "" , "This is a footnote.[^1] And this is a [link](https://www.google.com)." @@ -133,7 +133,7 @@ noteTests = testGroup "note and reference location" , test (markdownWithOpts defopts{writerReferenceLocation=EndOfBlock, writerReferenceLinks=True}) "footnotes and reference links at the end of blocks" $ noteTestDoc =?> - (unlines $ [ "First Header" + (unlines [ "First Header" , "============" , "" , "This is a footnote.[^1] And this is a [link]." @@ -156,7 +156,7 @@ noteTests = testGroup "note and reference location" , test (markdownWithOpts defopts{writerReferenceLocation=EndOfSection}) "footnotes at the end of section" $ noteTestDoc =?> - (unlines $ [ "First Header" + (unlines [ "First Header" , "============" , "" , "This is a footnote.[^1] And this is a [link](https://www.google.com)." @@ -186,27 +186,27 @@ shortcutLinkRefsTests = (=:) = test (purely (writeMarkdown defopts{writerReferenceLinks = True}) . toPandoc) in testGroup "Shortcut reference links" [ "Simple link (shortcutable)" - =: (para (link "/url" "title" "foo")) + =: para (link "/url" "title" "foo") =?> "[foo]\n\n [foo]: /url \"title\"" , "Followed by another link (unshortcutable)" - =: (para ((link "/url1" "title1" "first") - <> (link "/url2" "title2" "second"))) + =: para ((link "/url1" "title1" "first") + <> (link "/url2" "title2" "second")) =?> unlines [ "[first][][second]" , "" , " [first]: /url1 \"title1\"" , " [second]: /url2 \"title2\"" ] , "Followed by space and another link (unshortcutable)" - =: (para ((link "/url1" "title1" "first") <> " " - <> (link "/url2" "title2" "second"))) + =: para ((link "/url1" "title1" "first") <> " " + <> (link "/url2" "title2" "second")) =?> unlines [ "[first][] [second]" , "" , " [first]: /url1 \"title1\"" , " [second]: /url2 \"title2\"" ] , "Reference link is used multiple times (unshortcutable)" - =: (para ((link "/url1" "" "foo") <> (link "/url2" "" "foo") - <> (link "/url3" "" "foo"))) + =: para ((link "/url1" "" "foo") <> (link "/url2" "" "foo") + <> (link "/url3" "" "foo")) =?> unlines [ "[foo][][foo][1][foo][2]" , "" , " [foo]: /url1" @@ -214,8 +214,8 @@ shortcutLinkRefsTests = , " [2]: /url3" ] , "Reference link is used multiple times (unshortcutable)" - =: (para ((link "/url1" "" "foo") <> " " <> (link "/url2" "" "foo") - <> " " <> (link "/url3" "" "foo"))) + =: para ((link "/url1" "" "foo") <> " " <> (link "/url2" "" "foo") + <> " " <> (link "/url3" "" "foo")) =?> unlines [ "[foo][] [foo][1] [foo][2]" , "" , " [foo]: /url1" @@ -223,43 +223,43 @@ shortcutLinkRefsTests = , " [2]: /url3" ] , "Reference link is followed by text in brackets" - =: (para ((link "/url" "" "link") <> "[text in brackets]")) + =: para ((link "/url" "" "link") <> "[text in brackets]") =?> unlines [ "[link][]\\[text in brackets\\]" , "" , " [link]: /url" ] , "Reference link is followed by space and text in brackets" - =: (para ((link "/url" "" "link") <> " [text in brackets]")) + =: para ((link "/url" "" "link") <> " [text in brackets]") =?> unlines [ "[link][] \\[text in brackets\\]" , "" , " [link]: /url" ] , "Reference link is followed by RawInline" - =: (para ((link "/url" "" "link") <> rawInline "markdown" "[rawText]")) + =: para ((link "/url" "" "link") <> rawInline "markdown" "[rawText]") =?> unlines [ "[link][][rawText]" , "" , " [link]: /url" ] , "Reference link is followed by space and RawInline" - =: (para ((link "/url" "" "link") <> space <> rawInline "markdown" "[rawText]")) + =: para ((link "/url" "" "link") <> space <> rawInline "markdown" "[rawText]") =?> unlines [ "[link][] [rawText]" , "" , " [link]: /url" ] , "Reference link is followed by RawInline with space" - =: (para ((link "/url" "" "link") <> rawInline "markdown" " [rawText]")) + =: para ((link "/url" "" "link") <> rawInline "markdown" " [rawText]") =?> unlines [ "[link][] [rawText]" , "" , " [link]: /url" ] , "Reference link is followed by citation" - =: (para ((link "/url" "" "link") <> cite [Citation "author" [] [] NormalCitation 0 0] (str "[@author]"))) + =: para ((link "/url" "" "link") <> cite [Citation "author" [] [] NormalCitation 0 0] (str "[@author]")) =?> unlines [ "[link][][@author]" , "" , " [link]: /url" ] , "Reference link is followed by space and citation" - =: (para ((link "/url" "" "link") <> space <> cite [Citation "author" [] [] NormalCitation 0 0] (str "[@author]"))) + =: para ((link "/url" "" "link") <> space <> cite [Citation "author" [] [] NormalCitation 0 0] (str "[@author]")) =?> unlines [ "[link][] [@author]" , "" , " [link]: /url" diff --git a/test/Tests/Writers/Native.hs b/test/Tests/Writers/Native.hs index c22185968..0c4bf7623 100644 --- a/test/Tests/Writers/Native.hs +++ b/test/Tests/Writers/Native.hs @@ -18,5 +18,5 @@ p_write_blocks_rt bs = tests :: [TestTree] tests = [ testProperty "p_write_rt" p_write_rt , testProperty "p_write_blocks_rt" $ mapSize - (\x -> if x > 3 then 3 else x) $ p_write_blocks_rt + (\x -> if x > 3 then 3 else x) p_write_blocks_rt ] diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index cc94f822d..e179742ed 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -72,7 +72,7 @@ numSlideTests = testGroup "Number of slides in output" def (doc $ para "first slide" <> - (para $ image "lalune.jpg" "" "") <> + para (image "lalune.jpg" "" "") <> para "foo") , testNumberOfSlides "With image slide, header" 3 @@ -80,14 +80,14 @@ numSlideTests = testGroup "Number of slides in output" (doc $ para "first slide" <> header 2 "image header" <> - (para $ image "lalune.jpg" "" "") <> + para (image "lalune.jpg" "" "") <> para "foo") , testNumberOfSlides "With table, no header" 3 def (doc $ para "first slide" <> - (simpleTable [para "foo" <> para "bar"] [[para "this" <> para "that"]]) <> + simpleTable [para "foo" <> para "bar"] [[para "this" <> para "that"]] <> para "foo") , testNumberOfSlides "With table, header" 3 @@ -95,7 +95,7 @@ numSlideTests = testGroup "Number of slides in output" (doc $ para "first slide" <> header 2 "table header" <> - (simpleTable [para "foo" <> para "bar"] [[para "this" <> para "that"]]) <> + simpleTable [para "foo" <> para "bar"] [[para "this" <> para "that"]] <> para "foo") , testNumberOfSlides "hrule" 2 @@ -117,7 +117,7 @@ contentTypesFileExists opts pd = testCase "Existence of [Content_Types].xml file" $ do archive <- getPptxArchive opts pd assertBool "Missing [Content_Types].xml file" $ - "[Content_Types].xml" `elem` (filesInArchive archive) + "[Content_Types].xml" `elem` filesInArchive archive @@ -138,7 +138,7 @@ prop_ContentOverrides pd = do Nothing -> throwIO $ PandocSomeError "Missing [Content_Types].xml file" typesElem <- case parseXMLDoc contentTypes of - Just element -> return $ element + Just element -> return element Nothing -> throwIO $ PandocSomeError "[Content_Types].xml cannot be parsed" let ns = findAttr (QName "xmlns" Nothing Nothing) typesElem diff --git a/test/Tests/Writers/TEI.hs b/test/Tests/Writers/TEI.hs index f0a034bbd..fa372909f 100644 --- a/test/Tests/Writers/TEI.hs +++ b/test/Tests/Writers/TEI.hs @@ -31,7 +31,7 @@ tests = [ testGroup "block elements" ] , testGroup "inlines" [ - "Emphasis" =: emph ("emphasized") + "Emphasis" =: emph "emphasized" =?> "<p><hi rendition=\"simple:italic\">emphasized</hi></p>" ,"SingleQuoted" =: singleQuoted (text "quoted material") =?> "<p><quote>quoted material</quote></p>" |