Skip to content

Commit 8351e1d

Browse files
committed
test(docs): add edge case tests for :: in prose (HYBIM-725)
Documents behavior when :: appears mid-line (namespace::method) and when a prose line ends with :: but has no indented block following.
1 parent 340768c commit 8351e1d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/test_create_docs_helpers.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,19 @@ def test_prose_after_block_preserved(self):
117117
prose_idx = lines.index("More prose here.")
118118
assert prose_idx > fence_close
119119

120+
def test_prose_ending_in_double_colon_no_indented_block(self):
121+
"""Prose line ending in :: with no indented block following loses the :: but is otherwise intact."""
122+
text = "Refer to namespace::\n\nNext paragraph (not indented)."
123+
result = _convert_rst_code_blocks(text)
124+
assert "```" not in result
125+
assert "Refer to namespace" in result
126+
assert "Next paragraph (not indented)." in result
127+
128+
def test_double_colon_mid_line_not_treated_as_rst(self):
129+
""":: mid-line (e.g. namespace::method) does not trigger RST block conversion."""
130+
text = "Use namespace::method() here.\n\nMore text."
131+
assert _convert_rst_code_blocks(text) == text
132+
120133
def test_empty_string(self):
121134
"""Empty input returns empty string."""
122135
assert _convert_rst_code_blocks("") == ""

0 commit comments

Comments
 (0)