From 78e4fbda51a243f96176be001af8e538fcbc33c8 Mon Sep 17 00:00:00 2001
From: Daniele D'Orazio <daniele@develer.com>
Date: Wed, 26 Oct 2016 12:18:58 +0200
Subject: Markdown Reader: add attributes for autolink (#3183)

---
 tests/Tests/Readers/Markdown.hs | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

(limited to 'tests')

diff --git a/tests/Tests/Readers/Markdown.hs b/tests/Tests/Readers/Markdown.hs
index 9219b6930..739763e77 100644
--- a/tests/Tests/Readers/Markdown.hs
+++ b/tests/Tests/Readers/Markdown.hs
@@ -34,7 +34,10 @@ testBareLink (inp, ils) =
        inp (inp, doc $ para ils)
 
 autolink :: String -> Inlines
-autolink s = link s "" (str s)
+autolink = autolinkWith nullAttr
+
+autolinkWith :: Attr -> String -> Inlines
+autolinkWith attr s = linkWith attr s "" (str s)
 
 bareLinkTests :: [(String, Inlines)]
 bareLinkTests =
@@ -217,6 +220,12 @@ tests = [ testGroup "inline code"
           , "a partial URL (#2277)" =:
             "<www.boe.es/buscar/act.php?id=BOE-A-1996-8930#a66>" =?>
             para (text "<www.boe.es/buscar/act.php?id=BOE-A-1996-8930#a66>")
+          , "with some attributes" =:
+            "<http://foo.bar>{#i .j .z k=v}" =?>
+            para (autolinkWith ("i", ["j", "z"], [("k", "v")]) "http://foo.bar")
+          , "with some attributes and spaces" =:
+            "<http://foo.bar> {#i .j .z k=v}" =?>
+            para (autolink "http://foo.bar" <> space <> text "{#i .j .z k=v}")
           ]
         , testGroup "links"
           [ "no autolink inside link" =:
-- 
cgit v1.2.3