From cdd32e767b648002aa0ad3f9a563c971d46b9b8f Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Mon, 26 Feb 2018 00:24:02 +0000 Subject: 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. --- tests/data/renderer-def-links-w.md | 34 ++++++++++++++++++++++++++++++++++ tests/data/renderer-def-links.md | 34 ++++++++++++++++++++++++++++++++++ tests/test_md_tw.py | 5 +++++ 3 files changed, 73 insertions(+) create mode 100644 tests/data/renderer-def-links-w.md create mode 100644 tests/data/renderer-def-links.md 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]: "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]: "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 -- cgit v1.2.3