Skip to content

Restructure Klaviyo detector pattern tests#5026

Merged
martinlocklear merged 1 commit into
mainfrom
martinlocklear/cursor/klaviyo-pattern-tests
Jun 9, 2026
Merged

Restructure Klaviyo detector pattern tests#5026
martinlocklear merged 1 commit into
mainfrom
martinlocklear/cursor/klaviyo-pattern-tests

Conversation

@martinlocklear

@martinlocklear martinlocklear commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

[authored by Cursor]

Summary

  • Restructure the Klaviyo detector pattern test into one focused test per case
  • Add negative coverage: uppercase-hex body, a punctuation body, plus length boundaries for both key formats (legacy too-short, new-format tail too-long)

This is test-only; no production/detector code changes. It backs the tightened keyPat (pk_ + 34 lowercase hex, or pk_ + 6 alnum company_id + _ + 34 hex) that landed in #5009.

Test plan

  • go test ./pkg/detectors/klaviyo/ passes (new suite, CGO_ENABLED=0)
  • go vet + gofmt -l clean; go build ./... clean
  • CI / full community test pass

Made with Cursor

Rewrite the single table-driven pattern test as one focused test per
case, and add the coverage the tightened regex needs.

* Legacy lowercase-hex and the newer prefixed company_id format each get
  their own positive test.
* New negatives: uppercase-hex body, a legacy body one char short, and a
  new-format hex tail one char long.
* Inline each test's input and assertions; drop the shared fixture block.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Corpora Test Results

No detector regex or keyword changes in this PR. Bench skipped.

@martinlocklear martinlocklear marked this pull request as ready for review June 9, 2026 17:38
@martinlocklear martinlocklear requested a review from a team June 9, 2026 17:38
@martinlocklear martinlocklear requested a review from a team as a code owner June 9, 2026 17:38
@martinlocklear martinlocklear merged commit 28f515f into main Jun 9, 2026
19 of 21 checks passed
@martinlocklear martinlocklear deleted the martinlocklear/cursor/klaviyo-pattern-tests branch June 9, 2026 18:56
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.

2 participants