Skip to content

Commit

Permalink
Add test for uniquify heading ids
Browse files Browse the repository at this point in the history
  • Loading branch information
naokazuterada committed Jul 30, 2017
1 parent 399ce6e commit b82ff11
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,25 @@ def test_no_headings(self):
"""
toc_txt = self.commonSetup(text)
self.assert_NotIn('^- ', toc_txt)
self.assert_NotIn('^- ', toc_txt)

def test_same_headings(self):
""" Same heading texts
"""
text = \
"""
<!-- MarkdownTOC autolink=true -->
<!-- /MarkdownTOC -->
# Heading
# Heading
# Heading
"""
toc_txt = self.commonSetup(text)
self.assert_In('- [Heading][heading]', toc_txt)
self.assert_In('- [Heading][heading-1]', toc_txt)
self.assert_In('- [Heading][heading-2]', toc_txt)

0 comments on commit b82ff11

Please sign in to comment.