aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Readers/Org
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-01-19 21:25:24 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2018-01-19 21:25:24 -0800
commitb8ffd834cff717fe424f22e506351f2ecec4655a (patch)
tree70359c33066bebf2ec4c54c1c2d78f38b49c0fb8 /test/Tests/Readers/Org
parent8b3707de0402165b5691f626370203fa8982a5dc (diff)
downloadpandoc-b8ffd834cff717fe424f22e506351f2ecec4655a.tar.gz
hlint code improvements.
Diffstat (limited to 'test/Tests/Readers/Org')
-rw-r--r--test/Tests/Readers/Org/Block/Header.hs2
-rw-r--r--test/Tests/Readers/Org/Block/List.hs18
-rw-r--r--test/Tests/Readers/Org/Directive.hs4
-rw-r--r--test/Tests/Readers/Org/Inline.hs59
-rw-r--r--test/Tests/Readers/Org/Inline/Note.hs1
-rw-r--r--test/Tests/Readers/Org/Inline/Smart.hs4
-rw-r--r--test/Tests/Readers/Org/Meta.hs28
7 files changed, 58 insertions, 58 deletions
diff --git a/test/Tests/Readers/Org/Block/Header.hs b/test/Tests/Readers/Org/Block/Header.hs
index d895c86e2..e8ad88558 100644
--- a/test/Tests/Readers/Org/Block/Header.hs
+++ b/test/Tests/Readers/Org/Block/Header.hs
@@ -130,7 +130,7 @@ tests =
mconcat [ para "foo"
, headerWith ("thing-other-thing", [], [])
1
- ((strikeout "thing") <> " other thing")
+ (strikeout "thing" <> " other thing")
]
, "Comment Trees" =:
diff --git a/test/Tests/Readers/Org/Block/List.hs b/test/Tests/Readers/Org/Block/List.hs
index 32bb13294..343682a80 100644
--- a/test/Tests/Readers/Org/Block/List.hs
+++ b/test/Tests/Readers/Org/Block/List.hs
@@ -75,16 +75,16 @@ tests =
]
, "Bullet List with Decreasing Indent" =:
- (" - Discovery\n\
- \ - Human After All\n") =?>
+ " - Discovery\n\
+ \ - Human After All\n" =?>
mconcat [ bulletList [ plain "Discovery" ]
, bulletList [ plain ("Human" <> space <> "After" <> space <> "All")]
]
, "Header follows Bullet List" =:
- (" - Discovery\n\
+ " - Discovery\n\
\ - Human After All\n\
- \* Homework") =?>
+ \* Homework" =?>
mconcat [ bulletList [ plain "Discovery"
, plain ("Human" <> space <> "After" <> space <> "All")
]
@@ -92,9 +92,9 @@ tests =
]
, "Bullet List Unindented with trailing Header" =:
- ("- Discovery\n\
+ "- Discovery\n\
\- Homework\n\
- \* NotValidListItem") =?>
+ \* NotValidListItem" =?>
mconcat [ bulletList [ plain "Discovery"
, plain "Homework"
]
@@ -166,14 +166,14 @@ tests =
, "Ordered List in Bullet List" =:
("- Emacs\n" <>
" 1. Org\n") =?>
- bulletList [ (plain "Emacs") <>
- (orderedList [ plain "Org"])
+ bulletList [ plain "Emacs" <>
+ orderedList [ plain "Org"]
]
, "Bullet List in Ordered List" =:
("1. GNU\n" <>
" - Freedom\n") =?>
- orderedList [ (plain "GNU") <> bulletList [ (plain "Freedom") ] ]
+ orderedList [ plain "GNU" <> bulletList [ plain "Freedom" ] ]
, "Definition List" =:
T.unlines [ "- PLL :: phase-locked loop"
diff --git a/test/Tests/Readers/Org/Directive.hs b/test/Tests/Readers/Org/Directive.hs
index 862315ef3..7e2c0fb8d 100644
--- a/test/Tests/Readers/Org/Directive.hs
+++ b/test/Tests/Readers/Org/Directive.hs
@@ -107,8 +107,8 @@ tests =
] =?>
mconcat [ para "first block"
, orderedList
- [ (para "top-level section 1" <>
- orderedList [ para "subsection" ])
+ [ para "top-level section 1" <>
+ orderedList [ para "subsection" ]
, para "top-level section 2" ]
]
diff --git a/test/Tests/Readers/Org/Inline.hs b/test/Tests/Readers/Org/Inline.hs
index cb50ba630..da0d1db0b 100644
--- a/test/Tests/Readers/Org/Inline.hs
+++ b/test/Tests/Readers/Org/Inline.hs
@@ -36,7 +36,7 @@ tests =
, "Underline" =:
"_underline_" =?>
- para (underlineSpan $ "underline")
+ para (underlineSpan "underline")
, "Strikeout" =:
"+Kill Bill+" =?>
@@ -127,11 +127,12 @@ tests =
, "Markup should work properly after a blank line" =:
T.unlines ["foo", "", "/bar/"] =?>
- (para $ text "foo") <> (para $ emph $ text "bar")
+ para (text "foo") <>
+ para (emph $ text "bar")
, "Inline math must stay within three lines" =:
T.unlines [ "$a", "b", "c$", "$d", "e", "f", "g$" ] =?>
- para ((math "a\nb\nc") <> softbreak <>
+ para (math "a\nb\nc" <> softbreak <>
"$d" <> softbreak <> "e" <> softbreak <>
"f" <> softbreak <> "g$")
@@ -139,7 +140,7 @@ tests =
"$a$ $b$! $c$?" =?>
para (spcSep [ math "a"
, "$b$!"
- , (math "c") <> "?"
+ , math "c" <> "?"
])
, "Markup may not span more than two lines" =:
@@ -166,12 +167,12 @@ tests =
para (mconcat $ intersperse softbreak
[ "a" <> subscript "(a(b)(c)d)"
, "e" <> superscript "(f(g)h)"
- , "i" <> (subscript "(jk)") <> "l)"
- , "m" <> (superscript "()") <> "n"
+ , "i" <> subscript "(jk)" <> "l)"
+ , "m" <> superscript "()" <> "n"
, "o" <> subscript "p{q{}r}"
, "s" <> superscript "t{u}v"
- , "w" <> (subscript "xy") <> "z}"
- , "1" <> (superscript "") <> "2"
+ , "w" <> subscript "xy" <> "z}"
+ , "1" <> superscript "" <> "2"
, "3" <> subscript "{}"
, "4" <> superscript ("(a(" <> strong "b(c" <> ")d))")
])
@@ -182,17 +183,17 @@ tests =
, testGroup "Images"
[ "Image" =:
"[[./sunset.jpg]]" =?>
- (para $ image "./sunset.jpg" "" "")
+ para (image "./sunset.jpg" "" "")
, "Image with explicit file: prefix" =:
"[[file:sunrise.jpg]]" =?>
- (para $ image "sunrise.jpg" "" "")
+ para (image "sunrise.jpg" "" "")
, "Multiple images within a paragraph" =:
T.unlines [ "[[file:sunrise.jpg]]"
, "[[file:sunset.jpg]]"
] =?>
- (para $ (image "sunrise.jpg" "" "")
+ para ((image "sunrise.jpg" "" "")
<> softbreak
<> (image "sunset.jpg" "" ""))
@@ -200,75 +201,75 @@ tests =
T.unlines [ "#+ATTR_HTML: :width 50%"
, "[[file:guinea-pig.gif]]"
] =?>
- (para $ imageWith ("", [], [("width", "50%")]) "guinea-pig.gif" "" "")
+ para (imageWith ("", [], [("width", "50%")]) "guinea-pig.gif" "" "")
]
, "Explicit link" =:
"[[http://zeitlens.com/][pseudo-random /nonsense/]]" =?>
- (para $ link "http://zeitlens.com/" ""
+ para (link "http://zeitlens.com/" ""
("pseudo-random" <> space <> emph "nonsense"))
, "Self-link" =:
"[[http://zeitlens.com/]]" =?>
- (para $ link "http://zeitlens.com/" "" "http://zeitlens.com/")
+ para (link "http://zeitlens.com/" "" "http://zeitlens.com/")
, "Absolute file link" =:
"[[/url][hi]]" =?>
- (para $ link "file:///url" "" "hi")
+ para (link "file:///url" "" "hi")
, "Link to file in parent directory" =:
"[[../file.txt][moin]]" =?>
- (para $ link "../file.txt" "" "moin")
+ para (link "../file.txt" "" "moin")
, "Empty link (for gitit interop)" =:
"[[][New Link]]" =?>
- (para $ link "" "" "New Link")
+ para (link "" "" "New Link")
, "Image link" =:
"[[sunset.png][file:dusk.svg]]" =?>
- (para $ link "sunset.png" "" (image "dusk.svg" "" ""))
+ para (link "sunset.png" "" (image "dusk.svg" "" ""))
, "Image link with non-image target" =:
"[[http://example.com][./logo.png]]" =?>
- (para $ link "http://example.com" "" (image "./logo.png" "" ""))
+ para (link "http://example.com" "" (image "./logo.png" "" ""))
, "Plain link" =:
"Posts on http://zeitlens.com/ can be funny at times." =?>
- (para $ spcSep [ "Posts", "on"
+ para (spcSep [ "Posts", "on"
, link "http://zeitlens.com/" "" "http://zeitlens.com/"
, "can", "be", "funny", "at", "times."
])
, "Angle link" =:
"Look at <http://moltkeplatz.de> for fnords." =?>
- (para $ spcSep [ "Look", "at"
+ para (spcSep [ "Look", "at"
, link "http://moltkeplatz.de" "" "http://moltkeplatz.de"
, "for", "fnords."
])
, "Absolute file link" =:
"[[file:///etc/passwd][passwd]]" =?>
- (para $ link "file:///etc/passwd" "" "passwd")
+ para (link "file:///etc/passwd" "" "passwd")
, "File link" =:
"[[file:target][title]]" =?>
- (para $ link "target" "" "title")
+ para (link "target" "" "title")
, "Anchor" =:
"<<anchor>> Link here later." =?>
- (para $ spanWith ("anchor", [], []) mempty <>
+ para (spanWith ("anchor", [], []) mempty <>
"Link" <> space <> "here" <> space <> "later.")
, "Inline code block" =:
"src_emacs-lisp{(message \"Hello\")}" =?>
- (para $ codeWith ( ""
+ para (codeWith ( ""
, [ "commonlisp" ]
, [ ("org-language", "emacs-lisp") ])
"(message \"Hello\")")
, "Inline code block with arguments" =:
"src_sh[:export both :results output]{echo 'Hello, World'}" =?>
- (para $ codeWith ( ""
+ para (codeWith ( ""
, [ "bash" ]
, [ ("org-language", "sh")
, ("export", "both")
@@ -279,7 +280,7 @@ tests =
, "Inline code block with toggle" =:
"src_sh[:toggle]{echo $HOME}" =?>
- (para $ codeWith ( ""
+ para (codeWith ( ""
, [ "bash" ]
, [ ("org-language", "sh")
, ("toggle", "yes")
@@ -415,7 +416,7 @@ tests =
in [
"Berkeley-style in-text citation" =:
"See @Dominik201408." =?>
- (para $ "See "
+ para ("See "
<> cite [dominikInText] "@Dominik201408"
<> ".")
@@ -468,7 +469,7 @@ tests =
, "MathML symbol in LaTeX-style" =:
"There is a hackerspace in Lübeck, Germany, called nbsp (unicode symbol: '\\nbsp')." =?>
- para ("There is a hackerspace in Lübeck, Germany, called nbsp (unicode symbol: ' ').")
+ para "There is a hackerspace in Lübeck, Germany, called nbsp (unicode symbol: ' ')."
, "MathML symbol in LaTeX-style, including braces" =:
"\\Aacute{}stor" =?>
diff --git a/test/Tests/Readers/Org/Inline/Note.hs b/test/Tests/Readers/Org/Inline/Note.hs
index 46416d7d8..9eb1d02d6 100644
--- a/test/Tests/Readers/Org/Inline/Note.hs
+++ b/test/Tests/Readers/Org/Inline/Note.hs
@@ -84,4 +84,3 @@ tests =
, para "next"
]
]
-
diff --git a/test/Tests/Readers/Org/Inline/Smart.hs b/test/Tests/Readers/Org/Inline/Smart.hs
index 7a5e653cf..77f10699d 100644
--- a/test/Tests/Readers/Org/Inline/Smart.hs
+++ b/test/Tests/Readers/Org/Inline/Smart.hs
@@ -38,9 +38,9 @@ tests =
, test orgSmart "Single quotes can be followed by emphasized text"
("Singles on the '/meat market/'" =?>
- para ("Singles on the " <> (singleQuoted $ emph "meat market")))
+ para ("Singles on the " <> singleQuoted (emph "meat market")))
, test orgSmart "Double quotes can be followed by emphasized text"
("Double income, no kids: \"/DINK/\"" =?>
- para ("Double income, no kids: " <> (doubleQuoted $ emph "DINK")))
+ para ("Double income, no kids: " <> doubleQuoted (emph "DINK")))
]
diff --git a/test/Tests/Readers/Org/Meta.hs b/test/Tests/Readers/Org/Meta.hs
index 3ad6f5d8b..409cd00ae 100644
--- a/test/Tests/Readers/Org/Meta.hs
+++ b/test/Tests/Readers/Org/Meta.hs
@@ -30,32 +30,32 @@ tests =
, "Title" =:
"#+TITLE: Hello, World" =?>
let titleInline = toList $ "Hello," <> space <> "World"
- meta = setMeta "title" (MetaInlines titleInline) $ nullMeta
+ meta = setMeta "title" (MetaInlines titleInline) nullMeta
in Pandoc meta mempty
, "Author" =:
"#+author: John /Emacs-Fanboy/ Doe" =?>
let author = toList . spcSep $ [ "John", emph "Emacs-Fanboy", "Doe" ]
- meta = setMeta "author" (MetaList [MetaInlines author]) $ nullMeta
+ meta = setMeta "author" (MetaList [MetaInlines author]) nullMeta
in Pandoc meta mempty
, "Multiple authors" =:
"#+author: James Dewey Watson, Francis Harry Compton Crick " =?>
let watson = MetaInlines $ toList "James Dewey Watson"
crick = MetaInlines $ toList "Francis Harry Compton Crick"
- meta = setMeta "author" (MetaList [watson, crick]) $ nullMeta
+ meta = setMeta "author" (MetaList [watson, crick]) nullMeta
in Pandoc meta mempty
, "Date" =:
"#+Date: Feb. *28*, 2014" =?>
- let date = toList . spcSep $ [ "Feb.", (strong "28") <> ",", "2014" ]
- meta = setMeta "date" (MetaInlines date) $ nullMeta
+ let date = toList . spcSep $ [ "Feb.", strong "28" <> ",", "2014" ]
+ meta = setMeta "date" (MetaInlines date) nullMeta
in Pandoc meta mempty
, "Description" =:
"#+DESCRIPTION: Explanatory text" =?>
let description = "Explanatory text"
- meta = setMeta "description" (MetaString description) $ nullMeta
+ meta = setMeta "description" (MetaString description) nullMeta
in Pandoc meta mempty
, "Properties drawer" =:
@@ -94,7 +94,7 @@ tests =
, "#+author: Max"
] =?>
let author = MetaInlines [Str "Max"]
- meta = setMeta "author" (MetaList [author]) $ nullMeta
+ meta = setMeta "author" (MetaList [author]) nullMeta
in Pandoc meta mempty
, "Logbook drawer" =:
@@ -135,7 +135,7 @@ tests =
, "Search links are read as emph" =:
"[[Wally][Where's Wally?]]" =?>
- (para (emph $ "Where's" <> space <> "Wally?"))
+ para (emph $ "Where's" <> space <> "Wally?")
, "Link to nonexistent anchor" =:
T.unlines [ "<<link-here>> Target."
@@ -149,25 +149,25 @@ tests =
T.unlines [ "#+LINK: wp https://en.wikipedia.org/wiki/%s"
, "[[wp:Org_mode][Wikipedia on Org-mode]]"
] =?>
- (para (link "https://en.wikipedia.org/wiki/Org_mode" ""
- ("Wikipedia" <> space <> "on" <> space <> "Org-mode")))
+ para (link "https://en.wikipedia.org/wiki/Org_mode" ""
+ ("Wikipedia" <> space <> "on" <> space <> "Org-mode"))
, "Link abbreviation, defined after first use" =:
T.unlines [ "[[zl:non-sense][Non-sense articles]]"
, "#+LINK: zl http://zeitlens.com/tags/%s.html"
] =?>
- (para (link "http://zeitlens.com/tags/non-sense.html" ""
- ("Non-sense" <> space <> "articles")))
+ para (link "http://zeitlens.com/tags/non-sense.html" ""
+ ("Non-sense" <> space <> "articles"))
, "Link abbreviation, URL encoded arguments" =:
T.unlines [ "#+link: expl http://example.com/%h/foo"
, "[[expl:Hello, World!][Moin!]]"
] =?>
- (para (link "http://example.com/Hello%2C%20World%21/foo" "" "Moin!"))
+ para (link "http://example.com/Hello%2C%20World%21/foo" "" "Moin!")
, "Link abbreviation, append arguments" =:
T.unlines [ "#+link: expl http://example.com/"
, "[[expl:foo][bar]]"
] =?>
- (para (link "http://example.com/foo" "" "bar"))
+ para (link "http://example.com/foo" "" "bar")
]