Skip to content

test: cover ASCII DEL boundary - #2943

Open
renanmpimentel wants to merge 1 commit into
validatorjs:masterfrom
renanmpimentel:test/ascii-del-boundary
Open

renanmpimentel wants to merge 1 commit into
validatorjs:masterfrom
renanmpimentel:test/ascii-del-boundary

Conversation

@renanmpimentel

@renanmpimentel renanmpimentel commented Oct 22, 2026 •

Copy link
Copy Markdown

Why this test matters

Narrowing the ASCII character class by one code point would incorrectly reject DEL (0x7F) while all earlier cases pass. One public-API test now protects that upper boundary.

Supertest audit method

I used the Supertest test-audit skill to probe whether the existing suite would catch a plausible violation of this contract. The regression was applied only in an isolated worktree. The regression proof records three executed states: the existing tests pass with that regression, the new assertion fails against the same regression, and the new test passes with the original production code restored. The published diff adds tests only.

Adds the DEL character (0x7F) to the isAscii regression cases. DEL is the upper boundary of the ASCII range accepted by the implementation.

Proof: narrowing the character class from \x00-\x7F to \x00-\x7E leaves all 323 existing tests passing, but fails this new public API assertion. With the production regex restored, the full npm test suite passes with 323 tests and lint; node --check test/validators.test.js and git diff --check also pass.

This PR changes tests only.

Checklist

  • PR contains only related changes; the diff adds one test case.
  • README updated (not applicable: behavior and API are unchanged).
  • Tests written and npm test passed locally.
  • References provided (not applicable: the boundary is the documented/public ASCII contract).

Repository guidance

AGENTS.md and CONTRIBUTING.md call for a focused regression test, npm test, and no generated-file edits; the diff is one test line. The repository template checklist is included below.

@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9ff3424) to head (cc8c551).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2943   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2599      2599           
  Branches       658       658           
=========================================
  Hits          2599      2599           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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