Skip to content

Add additional test cases for opencode-hooks matcher sanitization #1016

@dyoshikawa

Description

@dyoshikawa

Summary

Follow-up from PR #1012 code review. Minor test coverage improvements suggested for validateAndSanitizeMatcher in opencode-hooks.

Tasks

  • Add test for backslash-containing matchers (e.g., \bWrite\b) to verify double-escaping produces correct generated code
  • Add test for NUL byte (\0) stripping (currently \n/\r are tested but \0 is not)
  • (Optional) Consider extracting the control character set (\n, \r, \0) into a shared constant between hasControlChars in hooks.ts and validateAndSanitizeMatcher in opencode-hooks.ts to prevent drift

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintainer-scrapRough notes for AI implementation. Not for human eyes.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions