Skip to content

test: strengthen marketplace redflags tests with boundary and severity coverage - #69

Merged
YASSERRMD merged 1 commit into
mainfrom
test/marketplace-redflags-tests
Jun 5, 2026
Merged

test: strengthen marketplace redflags tests with boundary and severity coverage#69
YASSERRMD merged 1 commit into
mainfrom
test/marketplace-redflags-tests

Conversation

@YASSERRMD

Copy link
Copy Markdown
Owner

Replaces the thin smoke test in internal/marketplace/redflags (which only asserted len(flags) < 4) with rigorous table-driven coverage, matching the rental redflags suite.

Coverage

  • TestScanIndividualRules — each rule fires in isolation (non-escrow payment via Western Union/gift card/crypto-only, shipping-via-seller, advance-fee, price-below-market, off-platform pressure), with case-insensitive payment matching and exactly-one-flag assertions.
  • TestScanBoundaries — pins exact thresholds (price ratio at 0.3 vs 0.29, zero/empty/negative inputs, inert ShippingMethod) to catch off-by-one regressions.
  • TestScanSeverities — locks the severity (1–5) and non-empty message for every code.
  • TestScanCleanSubmission — a legitimate listing produces no flags.

Verification

  • gofmt clean
  • go build ./... passes
  • go test ./... passes
  • golangci-lint run — 0 issues

@YASSERRMD
YASSERRMD merged commit 5ad494e into main Jun 5, 2026
5 of 6 checks passed
@YASSERRMD
YASSERRMD deleted the test/marketplace-redflags-tests branch June 5, 2026 19:41
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