Skip to content

test: reject Discord route edge cases in helpers - #55

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/test-coverage-automation-7bfa
Draft

test: reject Discord route edge cases in helpers#55
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/test-coverage-automation-7bfa

Conversation

@cursor

@cursor cursor Bot commented Jul 21, 2026

Copy link
Copy Markdown

Description

Extends Discord helper routing tests with negative cases for allowlist/mention gating without touching the production gateway parser.

Risky behavior now covered

  • Null payload → -1
  • Bot author messages skipped
  • Empty author id skipped
  • Guild messages with empty/null bot_user_id skipped (mention gate cannot widen)

Test files added/updated

  • tests/test_discord_helpers.c

Why these tests materially reduce regression risk

These pure helpers encode the Discord allowlist/bot/mention policy surface. Happy-path fixtures alone would miss regressions that accidentally accept bot traffic or guild traffic without bot identity.

How Has This Been Tested?

  • make test_discord_helpers + ./build/test_discord_helpers (all tests passed)

Note

Full Discord gateway (discord.c) production parser coverage still deferred — needs dedicated -DSHELLCLAW_TEST seams.

Open in Web View Automation 

Cover null payload, bot authors, empty author ids, and guild messages
without a bot user id so allowlist gating cannot silently widen.

Co-authored-by: esadrianno <esadrianno@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant