2010-04-16 17:51:19 +08:00
|
|
|
"""
|
|
|
|
|
test_rst_domain
|
|
|
|
|
~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
Tests the reStructuredText domain.
|
|
|
|
|
|
2019-01-02 16:00:30 +09:00
|
|
|
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
|
2010-04-16 17:51:19 +08:00
|
|
|
:license: BSD, see LICENSE for details.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
from sphinx.domains.rst import parse_directive
|
|
|
|
|
|
2010-04-17 10:29:14 +02:00
|
|
|
|
2016-06-12 00:00:52 +09:00
|
|
|
def test_parse_directive():
|
2018-12-15 23:02:28 +09:00
|
|
|
s = parse_directive(' foö ')
|
|
|
|
|
assert s == ('foö', '')
|
2010-04-17 10:29:14 +02:00
|
|
|
|
2018-12-15 23:02:28 +09:00
|
|
|
s = parse_directive(' .. foö :: ')
|
|
|
|
|
assert s == ('foö', ' ')
|
2010-04-17 10:29:14 +02:00
|
|
|
|
2018-12-15 23:02:28 +09:00
|
|
|
s = parse_directive('.. foö:: args1 args2')
|
|
|
|
|
assert s == ('foö', ' args1 args2')
|
2010-04-17 10:29:14 +02:00
|
|
|
|
2010-04-16 17:51:19 +08:00
|
|
|
s = parse_directive('.. :: bar')
|
|
|
|
|
assert s == ('.. :: bar', '')
|