diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-02-07 08:32:47 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-02-07 09:08:22 -0800 |
commit | 4c3db9273fc8e92c2c23d4455a6ab178472be06d (patch) | |
tree | cdfc8d65ebd56c0a571f8b46854465dd434489de /test | |
parent | 6cd77d4c638012be63d66882403804aa28feb6ed (diff) | |
download | pandoc-4c3db9273fc8e92c2c23d4455a6ab178472be06d.tar.gz |
Apply linter suggestions. Add fix_spacing to lint target in Makefile.
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Command.hs | 1 | ||||
-rw-r--r-- | test/Tests/Readers/Docx.hs | 2 | ||||
-rw-r--r-- | test/Tests/Readers/HTML.hs | 8 | ||||
-rw-r--r-- | test/Tests/Readers/Man.hs | 30 | ||||
-rw-r--r-- | test/Tests/Readers/Org/Meta.hs | 2 | ||||
-rw-r--r-- | test/Tests/Readers/Txt2Tags.hs | 6 | ||||
-rw-r--r-- | test/Tests/Writers/HTML.hs | 4 | ||||
-rw-r--r-- | test/Tests/Writers/Markdown.hs | 46 | ||||
-rw-r--r-- | test/Tests/Writers/RST.hs | 2 |
9 files changed, 50 insertions, 51 deletions
diff --git a/test/Tests/Command.hs b/test/Tests/Command.hs index f5fd45502..e645a34ec 100644 --- a/test/Tests/Command.hs +++ b/test/Tests/Command.hs @@ -18,7 +18,6 @@ import Data.Algorithm.Diff import qualified Data.ByteString as BS import qualified Data.Text as T import Data.List (isSuffixOf) -import Prelude hiding (readFile) import System.Directory import System.Exit import System.FilePath (joinPath, splitDirectories, takeDirectory, (</>)) diff --git a/test/Tests/Readers/Docx.hs b/test/Tests/Readers/Docx.hs index bc036e0cc..4d2e0d276 100644 --- a/test/Tests/Readers/Docx.hs +++ b/test/Tests/Readers/Docx.hs @@ -91,7 +91,7 @@ testForWarningsWithOpts opts name docxFile expected = getMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString) getMedia archivePath mediaPath = do - zf <- B.readFile archivePath >>= return . toArchive + zf <- toArchive <$> B.readFile archivePath return $ findEntryByPath ("word/" ++ mediaPath) zf >>= (Just . fromEntry) compareMediaPathIO :: FilePath -> MediaBag -> FilePath -> IO Bool diff --git a/test/Tests/Readers/HTML.hs b/test/Tests/Readers/HTML.hs index 189d37945..571c5ff49 100644 --- a/test/Tests/Readers/HTML.hs +++ b/test/Tests/Readers/HTML.hs @@ -95,14 +95,14 @@ tests = [ testGroup "base tag" ] , testGroup "samp" [ - test html "inline samp block" $ - "<samp>Answer is 42</samp>" =?> + test html "inline samp block" $ + "<samp>Answer is 42</samp>" =?> plain (codeWith ("",["sample"],[]) "Answer is 42") ] , testGroup "var" [ - test html "inline var block" $ - "<var>result</var>" =?> + test html "inline var block" $ + "<var>result</var>" =?> plain (codeWith ("",["variable"],[]) "result") ] , askOption $ \(QuickCheckTests numtests) -> diff --git a/test/Tests/Readers/Man.hs b/test/Tests/Readers/Man.hs index c3d2582ca..92a9207cb 100644 --- a/test/Tests/Readers/Man.hs +++ b/test/Tests/Readers/Man.hs @@ -51,13 +51,13 @@ tests = [ =?> header 2 (text "The header 2") , "Macro args" =: ".B \"single arg with \"\"Q\"\"\"" - =?> (para $ strong $ text "single arg with \"Q\"") + =?>para (strong $ text "single arg with \"Q\"") , "Argument from next line" =: ".B\nsingle arg with \"Q\"" - =?> (para $ strong $ text "single arg with \"Q\"") + =?>para (strong $ text "single arg with \"Q\"") , "comment" =: ".\\\"bla\naaa" - =?> (para $ str "aaa") + =?>para (str "aaa") , "link" =: ".BR aa (1)" =?> para (strong (str "aa") <> str "(1)") @@ -65,7 +65,7 @@ tests = [ testGroup "Escapes" [ "fonts" =: "aa\\fIbb\\fRcc" - =?> (para $ str "aa" <> (emph $ str "bb") <> str "cc") + =?>para (str "aa" <> (emph $ str "bb") <> str "cc") , "nested fonts" =: "\\f[BI]hi\\f[I] there\\f[R]" =?> para (emph (strong (text "hi") <> text " there")) @@ -75,26 +75,26 @@ tests = [ text " ok") , "skip" =: "a\\%\\\n\\:b\\0" - =?> (para $ str "ab\8199") + =?>para (str "ab\8199") , "replace" =: "\\-\\ \\\\\\[lq]\\[rq]\\[em]\\[en]\\*(lq\\*(rq" - =?> (para $ text "- \\“”—–“”") + =?>para (text "- \\“”—–“”") , "replace2" =: - "\\t\\e\\`\\^\\|\\'" =?> (para $ text "\\`\8202\8198`") + "\\t\\e\\`\\^\\|\\'" =?>para (text "\\`\8202\8198`") , "comment with \\\"" =: - "Foo \\\" bar\n" =?> (para $ text "Foo") + "Foo \\\" bar\n" =?>para (text "Foo") , "comment with \\#" =: - "Foo\\#\nbar\n" =?> (para $ text "Foobar") + "Foo\\#\nbar\n" =?>para (text "Foobar") , "two letter escapes" =: - "\\(oA\\(~O" =?> (para $ text "ÅÕ") + "\\(oA\\(~O" =?>para (text "ÅÕ") , "bracketed escapes" =: - "\\[oA]\\[~O]\\[Do]\\[Ye]\\[product]\\[ul]" =?> (para $ text "ÅÕ$¥∏_") + "\\[oA]\\[~O]\\[Do]\\[Ye]\\[product]\\[ul]" =?>para (text "ÅÕ$¥∏_") , "unicode escapes" =: - "\\[u2020]" =?> (para $ text "†") + "\\[u2020]" =?>para (text "†") , "unicode escapes (combined)" =: - "\\[u0075_u0301]" =?> (para $ text "\250") + "\\[u0075_u0301]" =?>para (text "\250") , "unknown escape (#5034)" =: - "\\9" =?> (para $ text "9") + "\\9" =?>para (text "9") ], testGroup "Lists" [ "bullet" =: @@ -108,7 +108,7 @@ tests = [ =?> orderedListWith (1,UpperAlpha,OneParen) [para $ str "first", para $ str "second"] , "nested" =: ".IP \"\\[bu]\"\nfirst\n.RS\n.IP \"\\[bu]\"\n1a\n.IP \"\\[bu]\"\n1b\n.RE" - =?> bulletList [(para $ str "first") <> (bulletList [para $ str "1a", para $ str "1b"])] + =?> bulletList [para (str "first") <> bulletList [para $ str "1a", para $ str "1b"]] , "change in list style" =: ".IP \\[bu]\nfirst\n.IP 1\nsecond" =?> bulletList [para (str "first")] <> diff --git a/test/Tests/Readers/Org/Meta.hs b/test/Tests/Readers/Org/Meta.hs index 2843bf0d0..3b89ac5ad 100644 --- a/test/Tests/Readers/Org/Meta.hs +++ b/test/Tests/Readers/Org/Meta.hs @@ -199,6 +199,6 @@ tests = , "#+pandoc-emphasis-post:" , "[/noemph/]" ] =?> - para ("[/noemph/]") + para "[/noemph/]" ] ] diff --git a/test/Tests/Readers/Txt2Tags.hs b/test/Tests/Readers/Txt2Tags.hs index 20b1e74e7..dbf388a0f 100644 --- a/test/Tests/Readers/Txt2Tags.hs +++ b/test/Tests/Readers/Txt2Tags.hs @@ -311,14 +311,14 @@ tests = , "Ordered List in Bullet List" =: ("- Emacs\n" <> " + Org\n") =?> - bulletList [ (plain "Emacs") <> - (orderedList [ plain "Org"]) + bulletList [ plain "Emacs" <> + orderedList [ plain "Org"] ] , "Bullet List in Ordered List" =: ("+ GNU\n" <> " - Freedom\n") =?> - orderedList [ (plain "GNU") <> bulletList [ (plain "Freedom") ] ] + orderedList [ plain "GNU" <> bulletList [ plain "Freedom" ] ] , "Definition List" =: T.unlines [ ": PLL" diff --git a/test/Tests/Writers/HTML.hs b/test/Tests/Writers/HTML.hs index f3c7b87fd..6ff0a6e1d 100644 --- a/test/Tests/Writers/HTML.hs +++ b/test/Tests/Writers/HTML.hs @@ -74,13 +74,13 @@ tests = [ testGroup "inline code" , testGroup "sample with style" [ "samp should wrap highlighted code" =: codeWith ("",["sample","haskell"],[]) ">>=" - =?> ("<samp><code class=\"sourceCode haskell\">" ++ + =?> ("<samp><code class=\"sourceCode haskell\">" ++ "<span class=\"op\">>>=</span></code></samp>") ] , testGroup "variable with style" [ "var should wrap highlighted code" =: codeWith ("",["haskell","variable"],[]) ">>=" - =?> ("<var><code class=\"sourceCode haskell\">" ++ + =?> ("<var><code class=\"sourceCode haskell\">" ++ "<span class=\"op\">>>=</span></code></var>") ] ] diff --git a/test/Tests/Writers/Markdown.hs b/test/Tests/Writers/Markdown.hs index aae4d082c..00f883ecb 100644 --- a/test/Tests/Writers/Markdown.hs +++ b/test/Tests/Writers/Markdown.hs @@ -93,7 +93,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)." @@ -110,11 +110,11 @@ noteTests = testGroup "note and reference location" , "[^1]: Down here." , "" , "[^2]: The second note." - ]) + ] , 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)." @@ -131,11 +131,11 @@ noteTests = testGroup "note and reference location" , "=============" , "" , "Some more text." - ]) + ] , 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]." @@ -154,11 +154,11 @@ noteTests = testGroup "note and reference location" , "=============" , "" , "Some more text." - ]) + ] , 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)." @@ -175,7 +175,7 @@ noteTests = testGroup "note and reference location" , "=============" , "" , "Some more text." - ]) + ] ] @@ -191,24 +191,24 @@ shortcutLinkRefsTests = =: 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" @@ -216,8 +216,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" @@ -225,43 +225,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/RST.hs b/test/Tests/Writers/RST.hs index e6377c02f..a52423fad 100644 --- a/test/Tests/Writers/RST.hs +++ b/test/Tests/Writers/RST.hs @@ -175,6 +175,6 @@ tests = [ testGroup "rubrics" , "--------"] ] , testTemplate "$subtitle$\n" "subtitle" $ - (setMeta "subtitle" ("subtitle" :: Inlines) $ doc $ plain "") =?> + setMeta "subtitle" ("subtitle" :: Inlines) (doc $ plain "") =?> ("subtitle" :: String) ] |