Skip to content

test: Remove duplicate and theatrical tests#2531

Merged
louisgv merged 3 commits intomainfrom
qa/dedup-scanner
Mar 12, 2026
Merged

test: Remove duplicate and theatrical tests#2531
louisgv merged 3 commits intomainfrom
qa/dedup-scanner

Conversation

@la14-1
Copy link
Member

@la14-1 la14-1 commented Mar 12, 2026

Summary

  • Consolidated 8 fragmented validatePrompt pipe-to-bash/sh it blocks into 2 data-driven tests covering all inputs (normal, with extra whitespace, in complex pipeline chains, and safe standalone-word acceptance)
  • Merged 3 separate backtick tests into 1 test covering paired/empty/unclosed backticks
  • Merged 2 whitespace-character acceptance tests (tabs, carriage returns) into 1

Stats: 19 lines removed from security.test.ts. Test count: 106 → 98 (8 tests removed, no coverage lost). Full suite: 1388 pass, 0 fail.

Test plan

  • bun test packages/cli/src/__tests__/security.test.ts — 98 pass, 0 fail
  • bun test (full suite) — 1388 pass, 0 fail
  • bunx @biomejs/biome check packages/cli/src/__tests__/security.test.ts — no errors

-- qa/dedup-scanner

🤖 Generated with Claude Code

Consolidate 8 fragmented pipe-to-bash/sh tests in validatePrompt into 2
data-driven tests covering all inputs (with/without whitespace, complex
pipelines, and standalone word acceptance). Merge 3 backtick tests into 1.
Merge 2 whitespace tests into 1. Removes 19 lines of duplicate test setup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Member

@louisgv louisgv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security Review

Verdict: APPROVED
Commit: f14f6ec

Findings

No security issues found. This PR successfully consolidates duplicate test cases without introducing vulnerabilities.

Changes:

  • Consolidated pipe-to-bash/sh tests into parameterized test
  • Merged bash/sh standalone word tests
  • Combined whitespace handling tests
  • Unified backtick command substitution tests
  • Removed redundant validation tests

Impact: Purely test refactoring - improves maintainability while preserving identical coverage.

Tests

  • bun test: PASS (1388/1388 tests pass, 0 failures)
  • biome lint: PASS (0 errors)
  • Security impact: NONE (test-only changes)
  • Test coverage: PRESERVED (all original cases still covered)

-- security/pr-reviewer

@louisgv louisgv merged commit 595e36f into main Mar 12, 2026
5 checks passed
@louisgv louisgv deleted the qa/dedup-scanner branch March 12, 2026 13:35
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