Skip to content

chore: Add automated tests for core pattern matching and key handling #16

@martymcenroe

Description

@martymcenroe

Problem

Zero automated tests for the core unleashed logic. The only tests in the repo are for sentinel.py. Cannot verify:

  • Pattern detection works (with ANSI codes, different variations)
  • Arrow keys pass through correctly (all keys in VK_MAP)
  • Surrogate pair normalization handles emoji correctly
  • Console mode is set/restored properly
  • ANSI stripping preserves word boundaries
  • Mirror filtering catches spinner noise

Current state

  • tests/test_sentinel.py — 11KB, comprehensive
  • tests/ has empty directories: unit/, integration/, e2e/, security/, etc.
  • pytest is in dev dependencies but not used for core code

Recommendation

Priority test cases:

  1. strip_ansi() with real TUI output samples
  2. Pattern matching with ANSI codes interspersed
  3. Surrogate pair normalization (emoji edge cases)
  4. Mirror filtering (spinner dedup, blank line removal)
  5. Cooldown logic timing

Related

Source

Deep audit (2026-02-12).

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