2010-04-16 17:51:19 +08:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
"""
|
|
|
|
|
test_rst_domain
|
|
|
|
|
~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
Tests the reStructuredText domain.
|
|
|
|
|
|
2017-03-22 20:21:12 +09:00
|
|
|
:copyright: Copyright 2007-2017 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():
|
2010-04-26 22:26:44 +02:00
|
|
|
s = parse_directive(u' foö ')
|
|
|
|
|
assert s == (u'foö', '')
|
2010-04-17 10:29:14 +02:00
|
|
|
|
2010-04-26 22:26:44 +02:00
|
|
|
s = parse_directive(u' .. foö :: ')
|
|
|
|
|
assert s == (u'foö', ' ')
|
2010-04-17 10:29:14 +02:00
|
|
|
|
2010-04-26 22:26:44 +02:00
|
|
|
s = parse_directive(u'.. foö:: args1 args2')
|
|
|
|
|
assert s == (u'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', '')
|