diff options
author | rsiddharth <s@ricketyspace.net> | 2018-01-02 00:49:28 +0000 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2018-01-02 00:49:28 +0000 |
commit | ad8fa809c55e2bf2a6bf2e977f6683e90ad7200d (patch) | |
tree | e6e83e16745922476d71831ea7c3c2de37b80683 /tests/test_md_tw.py | |
parent | 12903a82dc2ee039b0356855657e3f66173b9e92 (diff) |
md_tw.py: Add TWBlockLexer.parse_def_links.
* md_tw.py
(TWBlockLexer.parse_def_links): New method.
* tests/test_md_tw.py
(TestTWBlockLexer.test_parse_def_links): New test.
* tests/data/blexer-def-links.md: New file.
Diffstat (limited to 'tests/test_md_tw.py')
-rw-r--r-- | tests/test_md_tw.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_md_tw.py b/tests/test_md_tw.py index 4b78dcd..467caaf 100644 --- a/tests/test_md_tw.py +++ b/tests/test_md_tw.py @@ -463,6 +463,23 @@ class TestTWBlockLexer(object): } tokens = process(tokens) + def test_parse_def_links(self): + tokens = self._parse('blexer-def-links.md') + + expected_dls = [ + '[bob]: http://bob.name/ "Bob\'s home"\n', + '[alice]: <http://alice.name/> "Alice\'s home"\n\n', + '[bar]: http://bar.beer/ "Foo Bar Beer"\n\n', + '[GNU.org]: http://gnu.org\n\n', + ' [1]: http://google.com/ "Google"\n', + ' [2]: http://search.yahoo.com/ "Yahoo Search"\n', + ' [3]: http://search.msn.com/ "MSN Search"\n\n', + ' [google]: http://google.com/ "Google"\n', + ' [yahoo]: http://search.yahoo.com/ "Yahoo Search"\n', + ' [msn]: http://search.msn.com/ "MSN Search"', + ] + self._validate(tokens, 'def_links', expected_dls) + def teardown(self): pass |