Skip to content

Close remaining edge-case test gaps in resolve-frontmatter.sh helpers #603

Description

@williamthorsen

After #595 introduced YAML emission in resolve-frontmatter.sh, the round-1 test reviewer flagged three small test-coverage gaps that were deferred per the medium-effort policy. All three are mechanical single-test-case additions to packages/agents/content/scripts/__tests__/resolve_frontmatter_test.sh.

Tasks

  • F1: Add a structural pattern-match assertion for emit_yaml's canonical field order. Tests currently assert presence of all six canonical fields but not their relative ordering (ticket_idticket_refbranchcommitprrun_id). A pattern-match assertion against a fully-populated invocation (e.g., The output should match pattern "*ticket_id*ticket_ref*branch*commit*pr*run_id*") would pin the order. Source: Make resolve-frontmatter.sh emit the complete YAML frontmatter block #595 round-1 test reviewer (T1).

  • F2: Add a needs_yaml_quoting test for a bare colon as the complete value. The leading-: case is tested (via ":leading") but the minimal instance — a value of exactly ":" — is not. The predicate's :* case arm covers it, but the minimum is untested. Source: Make resolve-frontmatter.sh emit the complete YAML frontmatter block #595 round-1 test reviewer (T2).

  • F3: Add an end-to-end test for emit_yaml_flow_list with a list element containing an embedded single quote. The leaf yaml_quote function tests the doubling-escape, but the comma-split-then-element-quote path is not exercised together. When call emit_yaml_flow_list "refs" "it's,safe" asserting "refs: ['it''s', safe]" would close the gap. Source: Make resolve-frontmatter.sh emit the complete YAML frontmatter block #595 round-1 test reviewer (T3).

Context

These were intentionally deferred from #595's medium-effort run. The behaviors they cover are all correctly implemented and indirectly exercised by other tests; the gaps are purely about direct assertions on these specific edge cases. None of these tests should require new fixtures.

Related: #595.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions