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.

tests/test_strip_xml.py:18

Show on the map →

Called by none

Calls strip_xml

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 &amp; b</para>") == "a & b"

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-QUERY-003measuredtest_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 &amp; b</para>") == "a & b"

Activity · 2 steps
lines 20–22assert strip_xml("<para>Fails (n_tokens < 2) on a std::atomic<bool>.</para>") == ( "Fails (n_tokens < 2) on a std::atomic<bool>." )lines 25–25assert strip_xml("<para>a &amp; b</para>") == "a & b"

test_markup_is_still_removed

None test_strip_xml.test_markup_is_still_removed()

The ordinary case is unchanged: tags become spaces, runs collapse.

tests/test_strip_xml.py:45

Show on the map →

Called by none

Calls strip_xml

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

requirementlinkedpath to the implementer
REQ-DDB-QUERY-003measuredtest_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
lines 47–49assert ( strip_xml('<para>See <ref refid="x">f</ref>.</para><para>Next.</para>') == "See f . Next." )lines 50–50assert strip_xml(None) == ""

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.

tests/test_strip_xml.py:28

Show on the map →

Called by none

Calls strip_xml

Checks

  • assert strip_xml(stored) == "Holds a std::atomic<bool> flag; n_tokens < 2 & done."
  • assert strip_xml("<para>write &lt;para&gt; literally</para>") == "write <para> literally"

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-QUERY-003measuredtest_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&lt;bool&gt;` 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&lt;bool&gt;</computeroutput> flag; "
        "n_tokens < 2 &amp; 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 &lt;para&gt; literally</para>") == "write <para> literally"

Activity · 3 steps
lines 36–39stored = ( "<para>Holds a <computeroutput>std::atomic&lt;bool&gt;</computeroutput> flag; " "n_tokens < 2 &amp; done.</para>" )lines 40–40assert strip_xml(stored) == "Holds a std::atomic<bool> flag; n_tokens < 2 & done."lines 42–42assert strip_xml("<para>write &lt;para&gt; literally</para>") == "write <para> literally"