test_strip_xml.py¶
tests/test_strip_xml.py
Served description text keeps code text doxygen stored verbatim (owner Q/A 2026-11-20).
test_a_less_than_and_a_template_argument_survive
None test_strip_xml.test_a_less_than_and_a_template_argument_survive()
Code text stays; doxygen markup goes.
Checks
assert strip_xml("<para>Fails (n_tokens < 2) on a std::atomic<bool>.</para>") == ("Fails (n_tokens < 2) on a std::atomic<bool>." )assert strip_xml("<para>a & b</para>") == "a & b"
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-QUERY-003 | measured | test_a_less_than_and_a_template_argument_survive → strip_xml |
Source · 10 lines
def test_a_less_than_and_a_template_argument_survive() -> None:
"""@brief Code text stays; doxygen markup goes."""
assert strip_xml("<para>Fails (n_tokens < 2) on a std::atomic<bool>.</para>") == (
"Fails (n_tokens < 2) on a std::atomic<bool>."
)
## SPEC CHANGED (owner Q/A 2026-11-23, 2.0.1): entities are DECODED after the elements go,
## superseding "served as stored" — see the test below.
assert strip_xml("<para>a & b</para>") == "a & b"
Activity · 2 steps
test_markup_is_still_removed
None test_strip_xml.test_markup_is_still_removed()
The ordinary case is unchanged: tags become spaces, runs collapse.
Checks
assert (strip_xml('<para>See <ref refid="x">f</ref>.</para><para>Next.</para>') == "See f . Next." )assert strip_xml(None) == ""
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-QUERY-003 | measured | test_markup_is_still_removed → strip_xml |
Source · 6 lines
def test_markup_is_still_removed() -> None:
"""@brief The ordinary case is unchanged: tags become spaces, runs collapse."""
assert (
strip_xml('<para>See <ref refid="x">f</ref>.</para><para>Next.</para>') == "See f . Next."
)
assert strip_xml(None) == ""1 more lines, not shown
Activity · 2 steps
test_one_character_has_one_spelling_in_a_reply
None test_strip_xml.test_one_character_has_one_spelling_in_a_reply()
Entities decoded after the strip.
Checks
assert strip_xml(stored) == "Holds a std::atomic<bool> flag; n_tokens < 2 & done."assert strip_xml("<para>write <para> literally</para>") == "write <para> literally"
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-QUERY-003 | measured | test_one_character_has_one_spelling_in_a_reply → strip_xml |
Source · 17 lines
def test_one_character_has_one_spelling_in_a_reply() -> None:
"""FOUND BY ENTROPIC against the installed 2.0.0 (2026-11-23): doxygen stores the same
character two ways — verbatim in some descriptions, as an entity in others (inside
<computeroutput>) — so one reply could say `std::atomic<bool>` beside `n_tokens < 2`.
Entities are decoded after doxygen's elements are removed, so a reply reads as the source.
@brief Entities decoded after the strip.
"""
stored = (
"<para>Holds a <computeroutput>std::atomic<bool></computeroutput> flag; "
"n_tokens < 2 & done.</para>"
)
assert strip_xml(stored) == "Holds a std::atomic<bool> flag; n_tokens < 2 & done."
## An entity spelling markup is text once decoded: it is never stripped as an element.
assert strip_xml("<para>write <para> literally</para>") == "write <para> literally"