Skip to content

Test: xml_tagger wraps empty string in duplicate tags #196

@Serhan-Asad

Description

@Serhan-Asad

Bug

xml_tagger produces malformed output when given an empty string as content. When calling the tag function with content="", it wraps the empty string but produces duplicate closing tags.

Reproduction

from pdd.xml_tagger import wrap_xml
result = wrap_xml("test_tag", "")
# Expected: <test_tag></test_tag>
# Actual: <test_tag></test_tag></test_tag>

Failing Test

# tests/test_xml_tagger.py
def test_empty_content_wrapping():
    from pdd.xml_tagger import wrap_xml
    result = wrap_xml("test_tag", "")
    assert result == "<test_tag></test_tag>", f"Got: {result}"

Dev Unit

  • Module: xml_tagger
  • Prompt: prompts/xml_tagger_python.prompt
  • Code: pdd/xml_tagger.py
  • Test: tests/test_xml_tagger.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions