summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2018-02-26 00:24:02 +0000
committerrsiddharth <s@ricketyspace.net>2018-02-26 00:24:02 +0000
commitcdd32e767b648002aa0ad3f9a563c971d46b9b8f (patch)
tree5b80218e366c900ff14770f33c483ccbdb1eb69f /tests
parent34093b77787cffda9e84b16d133ee7fc5fcb777b (diff)
tests: Add TestTWRenderer.test_render_def_link.
* tests/data/renderer-def-links-w.md: New file. * tests/data/renderer-def-links.md: New file. * tests/test_md_tw.py (test_render_def_link): New test method.
Diffstat (limited to 'tests')
-rw-r--r--tests/data/renderer-def-links-w.md34
-rw-r--r--tests/data/renderer-def-links.md34
-rw-r--r--tests/test_md_tw.py5
3 files changed, 73 insertions, 0 deletions
diff --git a/tests/data/renderer-def-links-w.md b/tests/data/renderer-def-links-w.md
new file mode 100644
index 0000000..c09e417
--- /dev/null
+++ b/tests/data/renderer-def-links-w.md
@@ -0,0 +1,34 @@
+This is [an example](http://example.com/ "Title") inline link.
+
+[This link](http://example.net/) has no title attribute.
+
+See my [About](/about/) page for details.
+
+This is [Bob][bob]'s web space.
+
+This is [Alice][alice]'s web space.
+
+[bob]: http://bob.name/ "Bob's home"
+[alice]: <http://alice.name/> "Alice's home"
+
+Some foo[bar].
+
+[bar]: http://bar.beer/ "Foo Bar Beer"
+
+Visit [GNU.org][].
+
+[GNU.org]: http://gnu.org
+
+John Gruber gets 10 times more traffic from [Google][1] than from
+[Yahoo][2] or [MSN][3].
+
+ [1]: http://google.com/ "Google"
+ [2]: http://search.yahoo.com/ "Yahoo Search"
+ [3]: http://search.msn.com/ "MSN Search"
+
+John Gruber gets 10 times more traffic from [Google][] than from
+[Yahoo][] or [MSN][].
+
+ [google]: http://google.com/ "Google"
+ [yahoo]: http://search.yahoo.com/ "Yahoo Search"
+ [msn]: http://search.msn.com/ "MSN Search"
diff --git a/tests/data/renderer-def-links.md b/tests/data/renderer-def-links.md
new file mode 100644
index 0000000..c09e417
--- /dev/null
+++ b/tests/data/renderer-def-links.md
@@ -0,0 +1,34 @@
+This is [an example](http://example.com/ "Title") inline link.
+
+[This link](http://example.net/) has no title attribute.
+
+See my [About](/about/) page for details.
+
+This is [Bob][bob]'s web space.
+
+This is [Alice][alice]'s web space.
+
+[bob]: http://bob.name/ "Bob's home"
+[alice]: <http://alice.name/> "Alice's home"
+
+Some foo[bar].
+
+[bar]: http://bar.beer/ "Foo Bar Beer"
+
+Visit [GNU.org][].
+
+[GNU.org]: http://gnu.org
+
+John Gruber gets 10 times more traffic from [Google][1] than from
+[Yahoo][2] or [MSN][3].
+
+ [1]: http://google.com/ "Google"
+ [2]: http://search.yahoo.com/ "Yahoo Search"
+ [3]: http://search.msn.com/ "MSN Search"
+
+John Gruber gets 10 times more traffic from [Google][] than from
+[Yahoo][] or [MSN][].
+
+ [google]: http://google.com/ "Google"
+ [yahoo]: http://search.yahoo.com/ "Yahoo Search"
+ [msn]: http://search.msn.com/ "MSN Search"
diff --git a/tests/test_md_tw.py b/tests/test_md_tw.py
index 620605c..f2f5fd2 100644
--- a/tests/test_md_tw.py
+++ b/tests/test_md_tw.py
@@ -824,6 +824,11 @@ class TestTWRenderer(object):
expected_txt = self._get('renderer-hrules-w.md')
self._validate(txt, expected_txt)
+ def test_render_def_link(self):
+ txt = self._md('renderer-def-links.md')
+ expected_txt = self._get('renderer-def-links-w.md')
+ self._validate(txt, expected_txt)
+
def teardown(self):
pass