Skip to content

Commit

Permalink
Add test without 'autolink=true' param
Browse files Browse the repository at this point in the history
  • Loading branch information
naokazuterada committed Aug 17, 2017
1 parent d8383ce commit b456252
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,37 @@ def test_no_escape_in_code(self):
text = \
"""
<!-- MarkdownTOC -->
<!-- /MarkdownTOC -->
# `function(param, [optional])`
# (a static function) `greet([name])` (original, right?)
# `add(keys, command[, args][, context])`
# `get_context(key[, operator][, operand][, match_all])`
"""
toc_txt = self.commonSetup(text)
self.assert_In('- `function(param, [optional])`', toc_txt)
self.assert_In('- \\(a static function\\) `greet([name])` \\(original, right?\\)', toc_txt)
self.assert_In('- `add(keys, command[, args][, context])`', toc_txt)
self.assert_In('- `get_context(key[, operator][, operand][, match_all])`', toc_txt)

def test_no_escape_in_code(self):
""" No escape in codeblock (with link)"""
text = \
"""
<!-- MarkdownTOC autolink=true -->
<!-- /MarkdownTOC -->
## `function(param, [optional])`
## (a static function) `greet([name])` (original, right?)
# `function(param, [optional])`
# (a static function) `greet([name])` (original, right?)
# `add(keys, command[, args][, context])`
# `get_context(key[, operator][, operand][, match_all])`
"""
toc_txt = self.commonSetup(text)
self.assert_In('- [`function(param, [optional])`]'
'[functionparam-optional', toc_txt)
self.assert_In('- [\\(a static function\\) `greet([name])` \\(original, right?\\)]'
'[a-static-function-greetname-original-right]', toc_txt)
self.assert_In('- [`function(param, [optional])`][functionparam-optional]', toc_txt)
self.assert_In('- [\\(a static function\\) `greet([name])` \\(original, right?\\)][a-static-function-greetname-original-right]', toc_txt)
self.assert_In('- [`add(keys, command[, args][, context])`][addkeys-command-args-context]', toc_txt)
self.assert_In('- [`get_context(key[, operator][, operand][, match_all])`][getcontextkey-operator-operand-matchall]', toc_txt)

0 comments on commit b456252

Please sign in to comment.