Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Document working and committed frames in screen assertions #200

Done

Description

@tony

Summary

During synchronized output, the screen assertion helpers and golden serializer can show different text for the same Terminal. The serializer guide describes committed output. The assertion helpers accept a live terminal without naming their capture point.

Motivation

A test can assert NEW while its golden still shows OLD. This happens between CSI ? 2026 h and CSI ? 2026 l. A caller who passes term.snapshot() or term.committed can choose the same frame for both operations.

Evidence

Public API example verified on master and #193
from libvt import Terminal
from libvt.testing import assert_screen, serialize_vt_snapshot

term = Terminal(rows=1, cols=6)
term.feed(b"OLD\x1b[?2026h\rNEW")
assert_screen(term, "NEW")
assert "OLD" in serialize_vt_snapshot(term)
assert "NEW" in serialize_vt_snapshot(term.snapshot())

References

#2 added the working-frame assertion. #66 chose committed frames for goldens and #67 moved the serializer into libvt.testing. Add an executable held/committed example alongside the testing guide and name the capture point in the sibling assertion helpers. Preserve both existing defaults.

Activity

  1. added
    documentation
    p3
    area:dev-tools
    topic:api
    topic:examples
    python
    on Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:dev-toolsdocumentationp3pythontopic:apitopic:examples

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions