2016-08-29 10:37:30 -05:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
test_util_rst
|
|
|
|
~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Tests sphinx.util.rst functions.
|
|
|
|
|
2017-12-31 10:06:58 -06:00
|
|
|
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
|
2016-08-29 10:37:30 -05:00
|
|
|
:license: BSD, see LICENSE for details.
|
|
|
|
"""
|
|
|
|
from sphinx.util.rst import escape
|
|
|
|
|
|
|
|
|
|
|
|
def test_escape():
|
2017-02-12 11:02:51 -06:00
|
|
|
assert escape(':ref:`id`') == r'\:ref\:\`id\`'
|
|
|
|
assert escape('footnote [#]_') == r'footnote \[\#\]\_'
|
2018-01-28 03:58:58 -06:00
|
|
|
assert escape('sphinx.application') == r'sphinx.application'
|
|
|
|
assert escape('.. toctree::') == r'\.. toctree\:\:'
|