diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-12-14 02:02:29 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-12-14 02:02:29 +0900 |
commit | 2c98e909bf1a6de5f689aeca908e8ccc73f181ac (patch) | |
tree | 43752eff923aac12cd786424c1f5bb7725080143 /tests/test_domain_std.py | |
parent | 0b074c9e48dbc00137c2e94769bbe6e4685199c6 (diff) | |
parent | 5b28d77b376cad5d93942743ea1d18098b459948 (diff) | |
download | sphinx-git-2c98e909bf1a6de5f689aeca908e8ccc73f181ac.tar.gz |
Merge branch '3.x'
Diffstat (limited to 'tests/test_domain_std.py')
-rw-r--r-- | tests/test_domain_std.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_domain_std.py b/tests/test_domain_std.py index 8c8004a73..ad9450899 100644 --- a/tests/test_domain_std.py +++ b/tests/test_domain_std.py @@ -90,6 +90,28 @@ def test_get_full_qualified_name(): assert domain.get_full_qualified_name(node) == 'ls.-l' +def test_cmd_option_with_optional_value(app): + text = ".. option:: -j[=N]" + doctree = restructuredtext.parse(app, text) + assert_node(doctree, (index, + [desc, ([desc_signature, ([desc_name, '-j'], + [desc_addname, '[=N]'])], + [desc_content, ()])])) + objects = list(app.env.get_domain("std").get_objects()) + assert ('-j', '-j', 'cmdoption', 'index', 'cmdoption-j', 1) in objects + + +def test_cmd_option_starting_with_bracket(app): + text = ".. option:: [enable=]PATTERN" + doctree = restructuredtext.parse(app, text) + assert_node(doctree, (index, + [desc, ([desc_signature, ([desc_name, '[enable'], + [desc_addname, '=]PATTERN'])], + [desc_content, ()])])) + objects = list(app.env.get_domain("std").get_objects()) + assert ('[enable', '[enable', 'cmdoption', 'index', 'cmdoption-arg-enable', 1) in objects + + def test_glossary(app): text = (".. glossary::\n" "\n" |